Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ import gradio as gr
|
|
7 |
import sentencepiece
|
8 |
|
9 |
title = "Welcome to 🙋🏻♂️Tonic's🌷Tulu Chat!"
|
10 |
-
description = "[allenai/tulu-2-dpo-7b](https://huggingface.co/allenai/tulu-2-dpo-7b) and larger Tulu-2 models are Instruct Llama Finetunes using the [mistralai/Mistral-7B](https://huggingface.co/mistralai/Mistral-7B-v0.1) recipe. You can use [allenai/tulu-2-13b](https://huggingface.co/allenai/tulu-2-13b) here via API using Gradio by scrolling down and clicking Use 'Via API' or privately by [cloning this space on huggingface](https://huggingface.co/spaces/Tonic1/TuluDemo?duplicate=true) See also the large model here : [allenai/tulu-2-dpo-70b](https://huggingface.co/allenai/tulu-2-dpo-70b) . [Join my active builders' server on discord](https://discord.gg/VqTxc76K3u). Let's build together!. [Add this Space as a discord bot to your server by clicking this link](https://discord.com/oauth2/authorize?client_id=1176628808212828231&scope=bot+applications.commands&permissions=326417525824). Big thanks to 🤗Huggingface Organisation for the🫂Community Grant"
|
11 |
|
12 |
os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'max_split_size_mb:50'
|
13 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
@@ -61,7 +61,9 @@ def gradio_predict(user_message, system_message, max_new_tokens, temperature, to
|
|
61 |
Tulu_bot = TuluChatBot(model, tokenizer)
|
62 |
|
63 |
|
64 |
-
with gr.Blocks(
|
|
|
|
|
65 |
with gr.Row():
|
66 |
system_message = gr.Textbox(label="Optional 🌷Tulu Assistant Message", lines=2)
|
67 |
user_message = gr.Textbox(label="Your Message", lines=3)
|
@@ -71,7 +73,7 @@ with gr.Blocks(title ="Welcome to 🙋🏻♂️Tonic's🌷Tulu Chat!", descr
|
|
71 |
with gr.Accordion("Advanced Settings", open=lambda do_sample: do_sample):
|
72 |
with gr.Row():
|
73 |
max_new_tokens = gr.Slider(label="Max new tokens", value=1269, minimum=550, maximum=3200, step=1)
|
74 |
-
temperature = gr.Slider(label="Temperature", value=
|
75 |
top_p = gr.Slider(label="Top-p (nucleus sampling)", value=0.90, minimum=0.01, maximum=0.99, step=0.05)
|
76 |
repetition_penalty = gr.Slider(label="Repetition penalty", value=1.9, minimum=1.0, maximum=2.0, step=0.05)
|
77 |
|
|
|
7 |
import sentencepiece
|
8 |
|
9 |
title = "Welcome to 🙋🏻♂️Tonic's🌷Tulu Chat!"
|
10 |
+
description = """[allenai/tulu-2-dpo-7b](https://huggingface.co/allenai/tulu-2-dpo-7b) and larger Tulu-2 models are Instruct Llama Finetunes using the [mistralai/Mistral-7B](https://huggingface.co/mistralai/Mistral-7B-v0.1) recipe. You can use [allenai/tulu-2-13b](https://huggingface.co/allenai/tulu-2-13b) here via API using Gradio by scrolling down and clicking Use 'Via API' or privately by [cloning this space on huggingface](https://huggingface.co/spaces/Tonic1/TuluDemo?duplicate=true) See also the large model here : [allenai/tulu-2-dpo-70b](https://huggingface.co/allenai/tulu-2-dpo-70b) . [Join my active builders' server on discord](https://discord.gg/VqTxc76K3u). Let's build together!. [Add this Space as a discord bot to your server by clicking this link](https://discord.com/oauth2/authorize?client_id=1176628808212828231&scope=bot+applications.commands&permissions=326417525824). Big thanks to 🤗Huggingface Organisation for the🫂Community Grant"""
|
11 |
|
12 |
os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'max_split_size_mb:50'
|
13 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
|
|
61 |
Tulu_bot = TuluChatBot(model, tokenizer)
|
62 |
|
63 |
|
64 |
+
with gr.Blocks(theme = "ParityError/Anime") as demo:
|
65 |
+
gr.Markdown(title_md) # Display the title
|
66 |
+
gr.Markdown(description_md) # Display the description
|
67 |
with gr.Row():
|
68 |
system_message = gr.Textbox(label="Optional 🌷Tulu Assistant Message", lines=2)
|
69 |
user_message = gr.Textbox(label="Your Message", lines=3)
|
|
|
73 |
with gr.Accordion("Advanced Settings", open=lambda do_sample: do_sample):
|
74 |
with gr.Row():
|
75 |
max_new_tokens = gr.Slider(label="Max new tokens", value=1269, minimum=550, maximum=3200, step=1)
|
76 |
+
temperature = gr.Slider(label="Temperature", value=0.3, minimum=0.1, maximum=1.0, step=0.1)
|
77 |
top_p = gr.Slider(label="Top-p (nucleus sampling)", value=0.90, minimum=0.01, maximum=0.99, step=0.05)
|
78 |
repetition_penalty = gr.Slider(label="Repetition penalty", value=1.9, minimum=1.0, maximum=2.0, step=0.05)
|
79 |
|