Rooni commited on
Commit
c7ba344
·
1 Parent(s): 8086850

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
2
  import requests
3
  import json
4
  import os
5
- import markdown2 # Не забудьте импортировать библиотеку
6
 
7
  def generate_minecraft_command(description):
8
  headers = {
@@ -21,7 +21,7 @@ def generate_minecraft_command(description):
21
 
22
  if 'choices' in data and len(data['choices']) > 0:
23
  command = data['choices'][0]['message']['content'].strip()
24
-
25
  # Преобразование Markdown в HTML
26
  command_html = markdown2.markdown(command)
27
  return command_html
@@ -33,5 +33,5 @@ def generate_minecraft_command(description):
33
 
34
  iface = gr.Interface(fn=generate_minecraft_command, inputs=[
35
  gr.Textbox(label="Запрос")
36
- ], outputs=gr.Textbox(label="Ответ", type="html"), title="GPT") # Указываем тип вывода как "html"
37
  iface.launch()
 
2
  import requests
3
  import json
4
  import os
5
+ import markdown2
6
 
7
  def generate_minecraft_command(description):
8
  headers = {
 
21
 
22
  if 'choices' in data and len(data['choices']) > 0:
23
  command = data['choices'][0]['message']['content'].strip()
24
+
25
  # Преобразование Markdown в HTML
26
  command_html = markdown2.markdown(command)
27
  return command_html
 
33
 
34
  iface = gr.Interface(fn=generate_minecraft_command, inputs=[
35
  gr.Textbox(label="Запрос")
36
+ ], outputs=gr.Textbox(label="Ответ", markup=True), title="GPT") # Указываем markup=True
37
  iface.launch()