5m4ck3r commited on
Commit
d1af730
·
verified ·
1 Parent(s): f128547

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -15
app.py CHANGED
@@ -17,6 +17,7 @@ import gradio as gr
17
  chat_history = []
18
  nltk.download('punkt_tab')
19
  token = os.environ.get('HF_TOKEN')
 
20
  dataset_mng = DatasetManager(os.environ.get('DATASET'))
21
  tokeniz = AutoTokenizer.from_pretrained("iarfmoose/t5-base-question-generator")
22
  model = AutoModelForSeq2SeqLM.from_pretrained("iarfmoose/t5-base-question-generator")
@@ -353,21 +354,23 @@ with gr.Blocks() as demo:
353
  generate_qna_button = gr.Button("Find Answer")
354
  generate_qna_button.click(search_question, inputs=text_input_qna, outputs=text_output_qna)
355
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
356
  with gr.Tab("Chat"):
357
- gr.ChatInterface(
358
- respond,
359
- additional_inputs=[
360
- gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
361
- gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
362
- gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
363
- gr.Slider(
364
- minimum=0.1,
365
- maximum=1.0,
366
- value=0.95,
367
- step=0.05,
368
- label="Top-p (nucleus sampling)",
369
- ),
370
- ],
371
- )
372
 
373
  demo.launch()
 
17
  chat_history = []
18
  nltk.download('punkt_tab')
19
  token = os.environ.get('HF_TOKEN')
20
+ spc = os.environ.get('SPC')
21
  dataset_mng = DatasetManager(os.environ.get('DATASET'))
22
  tokeniz = AutoTokenizer.from_pretrained("iarfmoose/t5-base-question-generator")
23
  model = AutoModelForSeq2SeqLM.from_pretrained("iarfmoose/t5-base-question-generator")
 
354
  generate_qna_button = gr.Button("Find Answer")
355
  generate_qna_button.click(search_question, inputs=text_input_qna, outputs=text_output_qna)
356
 
357
+ # with gr.Tab("Chat"):
358
+ # gr.ChatInterface(
359
+ # respond,
360
+ # additional_inputs=[
361
+ # gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
362
+ # gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
363
+ # gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
364
+ # gr.Slider(
365
+ # minimum=0.1,
366
+ # maximum=1.0,
367
+ # value=0.95,
368
+ # step=0.05,
369
+ # label="Top-p (nucleus sampling)",
370
+ # ),
371
+ # ],
372
+ # )
373
  with gr.Tab("Chat"):
374
+ gr.HTML(f"<iframe src='{spc}' width='100%' height='80%'></iframe>")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
375
 
376
  demo.launch()