Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -174,6 +174,8 @@ def respond(
|
|
174 |
response += token.strip("")
|
175 |
yield response
|
176 |
|
|
|
|
|
177 |
def create_ui():
|
178 |
try:
|
179 |
css = """
|
@@ -238,7 +240,7 @@ def create_ui():
|
|
238 |
app_py_content = gr.Code(language="python", label="app.py", lines=30)
|
239 |
requirements_tab = gr.TabItem("requirements.txt")
|
240 |
with requirements_tab:
|
241 |
-
requirements_content = gr.
|
242 |
|
243 |
with gr.TabItem("AI μ½λ©"):
|
244 |
chatbot = gr.Chatbot()
|
@@ -250,9 +252,6 @@ def create_ui():
|
|
250 |
top_p = gr.Slider(minimum=0, maximum=1, value=0.9, label="Top P")
|
251 |
|
252 |
examples = [
|
253 |
-
["ν¨μ
μ½λ μ€ν"],
|
254 |
-
["UHD μ΄λ―Έμ§ μ½λ μ€ν"],
|
255 |
-
["MixGEN μ½λ μ€ν"],
|
256 |
["μμΈν μ¬μ© λ°©λ²μ λ§μΉ νλ©΄μ 보면μ μ€λͺ
νλ―μ΄ 4000 ν ν° μ΄μ μμΈν μ€λͺ
νλΌ"],
|
257 |
["FAQ 20건μ μμΈνκ² μμ±νλΌ. 4000ν ν° μ΄μ μ¬μ©νλΌ."],
|
258 |
["μ¬μ© λ°©λ²κ³Ό μ°¨λ³μ , νΉμ§, κ°μ μ μ€μ¬μΌλ‘ 4000 ν ν° μ΄μ μ νλΈ μμ μ€ν¬λ¦½νΈ ννλ‘ μμ±νλΌ"],
|
@@ -296,7 +295,10 @@ def create_ui():
|
|
296 |
def open_file(file_path: str, space_id: str):
|
297 |
content = get_file_content(space_id, file_path)
|
298 |
file_name = file_path.split('/')[-1]
|
299 |
-
|
|
|
|
|
|
|
300 |
|
301 |
analyze_button.click(
|
302 |
analyze_space,
|
@@ -358,4 +360,4 @@ if __name__ == "__main__":
|
|
358 |
demo.launch()
|
359 |
except Exception as e:
|
360 |
print(f"Error in main: {str(e)}")
|
361 |
-
print(traceback.format_exc())
|
|
|
174 |
response += token.strip("")
|
175 |
yield response
|
176 |
|
177 |
+
|
178 |
+
|
179 |
def create_ui():
|
180 |
try:
|
181 |
css = """
|
|
|
240 |
app_py_content = gr.Code(language="python", label="app.py", lines=30)
|
241 |
requirements_tab = gr.TabItem("requirements.txt")
|
242 |
with requirements_tab:
|
243 |
+
requirements_content = gr.Textbox(label="requirements.txt", lines=30)
|
244 |
|
245 |
with gr.TabItem("AI μ½λ©"):
|
246 |
chatbot = gr.Chatbot()
|
|
|
252 |
top_p = gr.Slider(minimum=0, maximum=1, value=0.9, label="Top P")
|
253 |
|
254 |
examples = [
|
|
|
|
|
|
|
255 |
["μμΈν μ¬μ© λ°©λ²μ λ§μΉ νλ©΄μ 보면μ μ€λͺ
νλ―μ΄ 4000 ν ν° μ΄μ μμΈν μ€λͺ
νλΌ"],
|
256 |
["FAQ 20건μ μμΈνκ² μμ±νλΌ. 4000ν ν° μ΄μ μ¬μ©νλΌ."],
|
257 |
["μ¬μ© λ°©λ²κ³Ό μ°¨λ³μ , νΉμ§, κ°μ μ μ€μ¬μΌλ‘ 4000 ν ν° μ΄μ μ νλΈ μμ μ€ν¬λ¦½νΈ ννλ‘ μμ±νλΌ"],
|
|
|
295 |
def open_file(file_path: str, space_id: str):
|
296 |
content = get_file_content(space_id, file_path)
|
297 |
file_name = file_path.split('/')[-1]
|
298 |
+
if file_name == "requirements.txt":
|
299 |
+
return gr.Tabs.update(selected="requirements.txt"), gr.Textbox.update(value=content, label=file_name)
|
300 |
+
else:
|
301 |
+
return gr.Tabs.update(selected=file_name), gr.Code.update(value=content, language="python" if file_name.endswith('.py') else "plaintext", label=file_name)
|
302 |
|
303 |
analyze_button.click(
|
304 |
analyze_space,
|
|
|
360 |
demo.launch()
|
361 |
except Exception as e:
|
362 |
print(f"Error in main: {str(e)}")
|
363 |
+
print(traceback.format_exc())
|