Update app.py
Browse files
app.py
CHANGED
|
@@ -2,9 +2,9 @@ import re
|
|
| 2 |
import gradio as gr
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
-
|
| 8 |
|
| 9 |
def text(prompt):
|
| 10 |
generate_kwargs = dict(
|
|
@@ -16,8 +16,8 @@ def text(prompt):
|
|
| 16 |
seed=42,
|
| 17 |
)
|
| 18 |
|
| 19 |
-
formatted_prompt =
|
| 20 |
-
stream =
|
| 21 |
formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
| 22 |
output = ""
|
| 23 |
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
|
| 5 |
+
client2 = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
| 6 |
|
| 7 |
+
system_instructions2 = "[SYSTEM] You are the Best AI, you can solve complex problems you answer in short , simple and easy language.[USER]"
|
| 8 |
|
| 9 |
def text(prompt):
|
| 10 |
generate_kwargs = dict(
|
|
|
|
| 16 |
seed=42,
|
| 17 |
)
|
| 18 |
|
| 19 |
+
formatted_prompt = system_instructions2 + prompt + "[BOT]"
|
| 20 |
+
stream = client2.text_generation(
|
| 21 |
formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
| 22 |
output = ""
|
| 23 |
|