memorease commited on
Commit
f9df685
·
verified ·
1 Parent(s): 27c7574

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -1,5 +1,3 @@
1
- # app.py
2
-
3
  import gradio as gr
4
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
5
 
@@ -12,11 +10,13 @@ def generate_question(description):
12
  outputs = model.generate(**inputs, max_new_tokens=64)
13
  return tokenizer.decode(outputs[0], skip_special_tokens=True)
14
 
15
- interface = gr.Interface(
 
16
  fn=generate_question,
17
  inputs=gr.Textbox(label="Memory Description"),
18
  outputs=gr.Textbox(label="Generated Question"),
 
 
19
  )
20
 
21
- demo = gr.Interface(fn=generate_question, inputs="text", outputs="text")
22
- demo.launch()
 
 
 
1
  import gradio as gr
2
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
3
 
 
10
  outputs = model.generate(**inputs, max_new_tokens=64)
11
  return tokenizer.decode(outputs[0], skip_special_tokens=True)
12
 
13
+ # DOĞRU Interface tanımı
14
+ demo = gr.Interface(
15
  fn=generate_question,
16
  inputs=gr.Textbox(label="Memory Description"),
17
  outputs=gr.Textbox(label="Generated Question"),
18
+ allow_flagging="never", # Opsiyonel: kullanıcı flag'lamasın diye
19
+ live=False # Gerek yoksa canlı inference yok
20
  )
21
 
22
+ demo.launch(server_name="0.0.0.0", server_port=7860) # Space sunucusunda doğru çalışması için