Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
|
|
@@ -12,7 +13,7 @@ def format_prompt(message, history, context):
|
|
| 12 |
return prompt
|
| 13 |
|
| 14 |
def generate(
|
| 15 |
-
prompt, history,
|
| 16 |
):
|
| 17 |
temperature = float(temperature)
|
| 18 |
if temperature < 1e-2:
|
|
@@ -38,17 +39,15 @@ def generate(
|
|
| 38 |
yield output
|
| 39 |
return output
|
| 40 |
|
| 41 |
-
|
| 42 |
-
|
| 43 |
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
)
|
| 51 |
|
| 52 |
-
|
| 53 |
-
iface.launch(share=True)
|
| 54 |
|
|
|
|
| 1 |
+
import os
|
| 2 |
import gradio as gr
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
|
|
|
|
| 13 |
return prompt
|
| 14 |
|
| 15 |
def generate(
|
| 16 |
+
prompt, history, temperature=0.2, max_new_tokens=4096, top_p=0.95, repetition_penalty=1.0, context="te llamas Facemaker, eres un asistente con humor nagro, muy sociable, usas emojis para expresar emociones, tienes 39 años",
|
| 17 |
):
|
| 18 |
temperature = float(temperature)
|
| 19 |
if temperature < 1e-2:
|
|
|
|
| 39 |
yield output
|
| 40 |
return output
|
| 41 |
|
| 42 |
+
mychatbot = gr.Chatbot(
|
| 43 |
+
avatar_images=["./user.png", "./botm.png"], bubble_full_width=False, show_label=False, show_copy_button=True, likeable=True,)
|
| 44 |
|
| 45 |
+
demo = gr.ChatInterface(fn=generate,
|
| 46 |
+
chatbot=mychatbot,
|
| 47 |
+
title="Mixtral 8x7b Chat",
|
| 48 |
+
retry_btn=None,
|
| 49 |
+
undo_btn=None
|
| 50 |
+
)
|
|
|
|
| 51 |
|
| 52 |
+
demo.queue().launch(show_api=True)
|
|
|
|
| 53 |
|