kevalfst commited on
Commit
67656e6
Β·
verified Β·
1 Parent(s): 233b266

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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
- demo.queue() # <-- Add this line
 
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()