Spaces:
Sleeping
Sleeping
a100 kh
commited on
Commit
Β·
eb0d262
1
Parent(s):
af40ecb
app.py
CHANGED
@@ -4,7 +4,7 @@ from openai import OpenAI
|
|
4 |
import os
|
5 |
openai_api_key = os.getenv('api_key')
|
6 |
openai_api_base = os.getenv('url')
|
7 |
-
model_name = "
|
8 |
"""
|
9 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
10 |
"""
|
@@ -18,12 +18,13 @@ client = OpenAI(
|
|
18 |
def respond(
|
19 |
message,
|
20 |
history: list[tuple[str, str]],
|
21 |
-
system_message,
|
22 |
max_tokens,
|
23 |
temperature,
|
24 |
top_p,
|
25 |
):
|
26 |
-
messages = [
|
|
|
27 |
|
28 |
for val in history:
|
29 |
if val[0]:
|
@@ -57,8 +58,8 @@ For information on how to customize the ChatInterface, peruse the gradio docs: h
|
|
57 |
demo = gr.ChatInterface(
|
58 |
respond,
|
59 |
additional_inputs=[
|
60 |
-
gr.Textbox(value="You are a friendly Chatbot.",
|
61 |
-
|
62 |
gr.Slider(minimum=1, maximum=2048, value=512,
|
63 |
step=1, label="Max new tokens"),
|
64 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7,
|
|
|
4 |
import os
|
5 |
openai_api_key = os.getenv('api_key')
|
6 |
openai_api_base = os.getenv('url')
|
7 |
+
model_name = "weblab-GENIAC/Tanuki-8x8B-dpo-v1.0"
|
8 |
"""
|
9 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
10 |
"""
|
|
|
18 |
def respond(
|
19 |
message,
|
20 |
history: list[tuple[str, str]],
|
21 |
+
# system_message,
|
22 |
max_tokens,
|
23 |
temperature,
|
24 |
top_p,
|
25 |
):
|
26 |
+
messages = [
|
27 |
+
{"role": "system", "content": "δ»₯δΈγ―γγΏγΉγ―γθͺ¬ζγγζη€Ίγ§γγθ¦ζ±γι©εγ«ζΊγγεΏηγζΈγγͺγγγ"}]
|
28 |
|
29 |
for val in history:
|
30 |
if val[0]:
|
|
|
58 |
demo = gr.ChatInterface(
|
59 |
respond,
|
60 |
additional_inputs=[
|
61 |
+
# gr.Textbox(value="You are a friendly Chatbot.",
|
62 |
+
# label="System message"),
|
63 |
gr.Slider(minimum=1, maximum=2048, value=512,
|
64 |
step=1, label="Max new tokens"),
|
65 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7,
|