Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -25,8 +25,7 @@ from concurrent.futures import ThreadPoolExecutor
|
|
25 |
from hdb_scan import HDBSCAN
|
26 |
import websockets
|
27 |
from websockets.exceptions import ConnectionClosed
|
28 |
-
from
|
29 |
-
|
30 |
# ========== Configuration ==========
|
31 |
WORKSPACE = Path("/tmp/issue_workspace")
|
32 |
WORKSPACE.mkdir(exist_ok=True)
|
@@ -253,6 +252,8 @@ def create_ui():
|
|
253 |
with gr.Column(scale=1):
|
254 |
model_select = gr.Dropdown(choices=list(HF_MODELS.keys()), value="Mistral-8x7B",
|
255 |
label="AI Model", info="Choose your resolution strategy")
|
|
|
|
|
256 |
crawl_btn = gr.Button("π Scan Repository", variant="primary")
|
257 |
|
258 |
with gr.Tabs():
|
@@ -297,14 +298,14 @@ def create_ui():
|
|
297 |
with gr.Row():
|
298 |
gr.Markdown("### π Achievement System")
|
299 |
badges = gr.HTML("<div class='badges'></div>")
|
300 |
-
|
301 |
# Enhanced Event Handlers
|
302 |
async def generate_patch(issue_num):
|
303 |
patch = await manager.generate_code_patch(issue_num)
|
304 |
return gr.JSON(value=patch)
|
305 |
|
306 |
def update_code_editor(files):
|
307 |
-
return code_editor(value=files)
|
308 |
|
309 |
issue_list.select(
|
310 |
fn=lambda evt: (evt[0], manager.issues[evt[0]]['body']),
|
@@ -343,8 +344,8 @@ def create_ui():
|
|
343 |
# ...
|
344 |
|
345 |
issue_num.change(
|
346 |
-
fn=lambda issue_num: create_code_editor(issue_num),
|
347 |
-
inputs=[issue_num],
|
348 |
outputs=code_edit
|
349 |
)
|
350 |
|
|
|
25 |
from hdb_scan import HDBSCAN
|
26 |
import websockets
|
27 |
from websockets.exceptions import ConnectionClosed
|
28 |
+
from code_editor import code_editor, generate_code_snippet
|
|
|
29 |
# ========== Configuration ==========
|
30 |
WORKSPACE = Path("/tmp/issue_workspace")
|
31 |
WORKSPACE.mkdir(exist_ok=True)
|
|
|
252 |
with gr.Column(scale=1):
|
253 |
model_select = gr.Dropdown(choices=list(HF_MODELS.keys()), value="Mistral-8x7B",
|
254 |
label="AI Model", info="Choose your resolution strategy")
|
255 |
+
language_select = gr.Dropdown(choices=["python", "javascript", "java", "c", "cpp", "html", "css", "bash", "ruby", "go", "php", "rust", "typescript"],
|
256 |
+
value="python", label="Select Language", info="Choose the programming language for the code editor")
|
257 |
crawl_btn = gr.Button("π Scan Repository", variant="primary")
|
258 |
|
259 |
with gr.Tabs():
|
|
|
298 |
with gr.Row():
|
299 |
gr.Markdown("### π Achievement System")
|
300 |
badges = gr.HTML("<div class='badges'></div>")
|
301 |
+
|
302 |
# Enhanced Event Handlers
|
303 |
async def generate_patch(issue_num):
|
304 |
patch = await manager.generate_code_patch(issue_num)
|
305 |
return gr.JSON(value=patch)
|
306 |
|
307 |
def update_code_editor(files):
|
308 |
+
return code_editor(value=files, language=language_select.value)
|
309 |
|
310 |
issue_list.select(
|
311 |
fn=lambda evt: (evt[0], manager.issues[evt[0]]['body']),
|
|
|
344 |
# ...
|
345 |
|
346 |
issue_num.change(
|
347 |
+
fn=lambda issue_num: create_code_editor(issue_num, language_select.value),
|
348 |
+
inputs=[issue_num, language_select],
|
349 |
outputs=code_edit
|
350 |
)
|
351 |
|