Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
# app.py
|
2 |
import gradio as gr
|
3 |
from transformers import pipeline, AutoTokenizer, AutoModelForSeq2SeqLM
|
4 |
import json
|
@@ -21,6 +20,7 @@ def generate_json(prompt):
|
|
21 |
|
22 |
return formatted_json
|
23 |
|
|
|
24 |
demo = gr.Interface(
|
25 |
fn=generate_json,
|
26 |
inputs=gr.Textbox(lines=4, label="Enter Prompt"),
|
@@ -29,5 +29,6 @@ demo = gr.Interface(
|
|
29 |
description="Enter a prompt describing the structure or content you want in JSON format."
|
30 |
)
|
31 |
|
32 |
-
|
|
|
33 |
demo.launch()
|
|
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline, AutoTokenizer, AutoModelForSeq2SeqLM
|
3 |
import json
|
|
|
20 |
|
21 |
return formatted_json
|
22 |
|
23 |
+
# π₯ Make sure to assign to a variable
|
24 |
demo = gr.Interface(
|
25 |
fn=generate_json,
|
26 |
inputs=gr.Textbox(lines=4, label="Enter Prompt"),
|
|
|
29 |
description="Enter a prompt describing the structure or content you want in JSON format."
|
30 |
)
|
31 |
|
32 |
+
# π This is what allows external API calls
|
33 |
+
demo.queue()
|
34 |
demo.launch()
|