Spaces:
No application file
No application file
Commit
·
ed2b885
1
Parent(s):
7130035
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import os
|
|
2 |
|
3 |
import gradio as gr
|
4 |
|
5 |
-
|
6 |
|
7 |
openchat_preprompt = (
|
8 |
"\n<human>: Hi!\n<bot>: My name is multivac, model version is 0.15, part of an open-source kit for "
|
@@ -12,13 +12,6 @@ openchat_preprompt = (
|
|
12 |
)
|
13 |
|
14 |
|
15 |
-
def get_client(model: str):
|
16 |
-
if model == "Rallio67/joi2_20Be_instruct_alpha":
|
17 |
-
return Client(os.getenv("JOI_API_URL"))
|
18 |
-
if model == "togethercomputer/GPT-NeoXT-Chat-Base-20B":
|
19 |
-
return Client(os.getenv("OPENCHAT_API_URL"))
|
20 |
-
return InferenceAPIClient(model, token=os.getenv("HF_TOKEN", None))
|
21 |
-
|
22 |
|
23 |
def get_usernames(model: str):
|
24 |
"""
|
@@ -27,11 +20,7 @@ def get_usernames(model: str):
|
|
27 |
"""
|
28 |
if model == "OpenAssistant/oasst-sft-1-pythia-12b":
|
29 |
return "", "<|prompter|>", "<|assistant|>", "<|endoftext|>"
|
30 |
-
|
31 |
-
return "", "User: ", "Joi: ", "\n\n"
|
32 |
-
if model == "togethercomputer/GPT-NeoXT-Chat-Base-20B":
|
33 |
-
return openchat_preprompt, "<human>: ", "<bot>: ", "\n"
|
34 |
-
return "", "User: ", "Assistant: ", "\n"
|
35 |
|
36 |
|
37 |
def predict(
|
@@ -161,7 +150,7 @@ def radio_on_change(
|
|
161 |
)
|
162 |
|
163 |
|
164 |
-
title = """<h1 align="center">🔥
|
165 |
description = """Language models can be conditioned to act like dialogue agents through a conversational prompt that typically takes the form:
|
166 |
```
|
167 |
User: <utterance>
|
|
|
2 |
|
3 |
import gradio as gr
|
4 |
|
5 |
+
gr.Interface.load("models/OpenAssistant/oasst-sft-1-pythia-12b").launch()
|
6 |
|
7 |
openchat_preprompt = (
|
8 |
"\n<human>: Hi!\n<bot>: My name is multivac, model version is 0.15, part of an open-source kit for "
|
|
|
12 |
)
|
13 |
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
def get_usernames(model: str):
|
17 |
"""
|
|
|
20 |
"""
|
21 |
if model == "OpenAssistant/oasst-sft-1-pythia-12b":
|
22 |
return "", "<|prompter|>", "<|assistant|>", "<|endoftext|>"
|
23 |
+
|
|
|
|
|
|
|
|
|
24 |
|
25 |
|
26 |
def predict(
|
|
|
150 |
)
|
151 |
|
152 |
|
153 |
+
title = """<h1 align="center">🔥SAPIENS-IA🚀</h1>"""
|
154 |
description = """Language models can be conditioned to act like dialogue agents through a conversational prompt that typically takes the form:
|
155 |
```
|
156 |
User: <utterance>
|