Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -23,11 +23,11 @@ def generate_minecraft_command(description):
|
|
23 |
return command
|
24 |
elif 'error' in data:
|
25 |
error_message = data['error']['message']
|
26 |
-
return f'
|
27 |
else:
|
28 |
-
return f'
|
29 |
|
30 |
iface = gr.Interface(fn=generate_minecraft_command, inputs=[
|
31 |
gr.Textbox(label="Запрос")
|
32 |
-
], outputs=gr.Textbox(label="Ответ",
|
33 |
iface.launch()
|
|
|
23 |
return command
|
24 |
elif 'error' in data:
|
25 |
error_message = data['error']['message']
|
26 |
+
return f'<b>Ошибка:</b> {error_message}'
|
27 |
else:
|
28 |
+
return f'<b>Не удалось сгенерировать команду.</b> {data}'
|
29 |
|
30 |
iface = gr.Interface(fn=generate_minecraft_command, inputs=[
|
31 |
gr.Textbox(label="Запрос")
|
32 |
+
], outputs=gr.Textbox(label="Ответ", html=True), title="GPT")
|
33 |
iface.launch()
|