Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,13 +9,6 @@ from threading import Thread
|
|
| 9 |
HF_TOKEN = os.environ.get("HF_TOKEN", None)
|
| 10 |
|
| 11 |
|
| 12 |
-
DESCRIPTION = '''
|
| 13 |
-
<div>
|
| 14 |
-
<h1 style="text-align: center;">GPT 4o</h1>
|
| 15 |
-
</div>
|
| 16 |
-
'''
|
| 17 |
-
|
| 18 |
-
|
| 19 |
# Load the tokenizer and model
|
| 20 |
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3")
|
| 21 |
model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3", device_map="auto")
|
|
@@ -63,11 +56,11 @@ def gpt4o_mistral(message: str,
|
|
| 63 |
|
| 64 |
|
| 65 |
# Gradio block
|
| 66 |
-
chatbot=gr.Chatbot(height=450, label='Gradio ChatInterface')
|
| 67 |
|
| 68 |
with gr.Blocks(fill_height=True) as demo:
|
| 69 |
|
| 70 |
-
|
| 71 |
gr.ChatInterface(
|
| 72 |
fn=gpt4o_mistral,
|
| 73 |
chatbot=chatbot,
|
|
@@ -95,7 +88,7 @@ with gr.Blocks(fill_height=True) as demo:
|
|
| 95 |
['Justify why a penguin might make a good king of the jungle.']
|
| 96 |
],
|
| 97 |
cache_examples=False,
|
| 98 |
-
|
| 99 |
)
|
| 100 |
|
| 101 |
|
|
|
|
| 9 |
HF_TOKEN = os.environ.get("HF_TOKEN", None)
|
| 10 |
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
# Load the tokenizer and model
|
| 13 |
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3")
|
| 14 |
model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3", device_map="auto")
|
|
|
|
| 56 |
|
| 57 |
|
| 58 |
# Gradio block
|
| 59 |
+
chatbot=gr.Chatbot(height=450, label='Gradio ChatInterface', theme="xiaobaiyuan/theme_brief")
|
| 60 |
|
| 61 |
with gr.Blocks(fill_height=True) as demo:
|
| 62 |
|
| 63 |
+
|
| 64 |
gr.ChatInterface(
|
| 65 |
fn=gpt4o_mistral,
|
| 66 |
chatbot=chatbot,
|
|
|
|
| 88 |
['Justify why a penguin might make a good king of the jungle.']
|
| 89 |
],
|
| 90 |
cache_examples=False,
|
| 91 |
+
|
| 92 |
)
|
| 93 |
|
| 94 |
|