Spaces:
Sleeping
Sleeping
Commit
·
44dfb88
1
Parent(s):
3459a2b
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,10 +2,7 @@ import huggingface_hub as hf_hub
|
|
| 2 |
import gradio as gr
|
| 3 |
import os
|
| 4 |
|
| 5 |
-
client = hf_hub.InferenceClient(
|
| 6 |
-
model = 'google/flan-t5-xxl',
|
| 7 |
-
token = os.environ['HUGGINGFACEHUB_API_TOKEN']
|
| 8 |
-
)
|
| 9 |
|
| 10 |
def create_prompt(question, history):
|
| 11 |
template = '''You are a good chatbot that talks with human.
|
|
@@ -31,7 +28,7 @@ def create_prompt(question, history):
|
|
| 31 |
|
| 32 |
def chat_interface(question, history):
|
| 33 |
prompt = create_prompt(question, history)
|
| 34 |
-
response = client.text_generation(prompt)
|
| 35 |
return response
|
| 36 |
|
| 37 |
chat_app = gr.ChatInterface(fn = chat_interface)
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
import os
|
| 4 |
|
| 5 |
+
client = hf_hub.InferenceClient(token = os.environ['HUGGINGFACEHUB_API_TOKEN'])
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
def create_prompt(question, history):
|
| 8 |
template = '''You are a good chatbot that talks with human.
|
|
|
|
| 28 |
|
| 29 |
def chat_interface(question, history):
|
| 30 |
prompt = create_prompt(question, history)
|
| 31 |
+
response = client.text_generation(prompt, model = 'google/flan-t5-xxl')
|
| 32 |
return response
|
| 33 |
|
| 34 |
chat_app = gr.ChatInterface(fn = chat_interface)
|