Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,6 @@ from huggingface_hub import InferenceClient
|
|
2 |
import gradio as gr
|
3 |
from pathlib import Path
|
4 |
import datetime
|
5 |
-
from gradio import js
|
6 |
|
7 |
# Initialize the InferenceClient
|
8 |
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
@@ -18,8 +17,7 @@ def format_prompt(message, history, system_prompt):
|
|
18 |
return prompt
|
19 |
|
20 |
def generate(prompt, history, user_system_prompt, temperature=0.9, max_new_tokens=9048, top_p=0.95, repetition_penalty=1.0):
|
21 |
-
system_prompt = '''
|
22 |
-
temperature = float(temperature)
|
23 |
if temperature < 1e-2:
|
24 |
temperature = 1e-2
|
25 |
|
@@ -64,7 +62,7 @@ additional_inputs = [
|
|
64 |
|
65 |
avatar_images = ("https://i.postimg.cc/pXjKKVXG/user-circle.png", "https://i.postimg.cc/qq04Yz93/CL3.png")
|
66 |
|
67 |
-
with gr.Blocks(
|
68 |
chatbot = gr.Chatbot(value=gr.Context.client.call('loadChat'))
|
69 |
gr.ChatInterface(
|
70 |
fn=generate,
|
|
|
2 |
import gradio as gr
|
3 |
from pathlib import Path
|
4 |
import datetime
|
|
|
5 |
|
6 |
# Initialize the InferenceClient
|
7 |
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
|
|
17 |
return prompt
|
18 |
|
19 |
def generate(prompt, history, user_system_prompt, temperature=0.9, max_new_tokens=9048, top_p=0.95, repetition_penalty=1.0):
|
20 |
+
system_prompt = ''' ''' temperature = float(temperature)
|
|
|
21 |
if temperature < 1e-2:
|
22 |
temperature = 1e-2
|
23 |
|
|
|
62 |
|
63 |
avatar_images = ("https://i.postimg.cc/pXjKKVXG/user-circle.png", "https://i.postimg.cc/qq04Yz93/CL3.png")
|
64 |
|
65 |
+
with gr.Blocks() as demo:
|
66 |
chatbot = gr.Chatbot(value=gr.Context.client.call('loadChat'))
|
67 |
gr.ChatInterface(
|
68 |
fn=generate,
|