project2you commited on
Commit
4632579
1 Parent(s): 21736f0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -12
app.py CHANGED
@@ -1,17 +1,9 @@
1
  from transformers import pipeline, Conversation
2
  import gradio as gr
3
 
4
- chatbot = pipeline(model="project2you/1_0_thai_llm2-gpt")
 
5
 
6
- message_list = []
7
- response_list = []
8
 
9
- def vanilla_chatbot(message, history):
10
- conversation = Conversation(text=message, past_user_inputs=message_list, generated_responses=response_list)
11
- conversation = chatbot(conversation)
12
-
13
- return conversation.generated_responses[-1]
14
-
15
- demo_chatbot = gr.ChatInterface(vanilla_chatbot, title="Chatbot", description="Enter text to start chatting.")
16
-
17
- demo_chatbot.launch()
 
1
  from transformers import pipeline, Conversation
2
  import gradio as gr
3
 
4
+ question = "การผลิตปลากระป๋องจัดเป็นอาชีพใด"
5
+ context = "ถามตอบ"
6
 
7
+ question_answerer = pipeline("question-answering", model="project2you/1_0_thai_llm2-gpt")
 
8
 
9
+ question_answerer(question=question, context=context)