Spaces:
Running
Running
yentinglin
commited on
Commit
•
734ba33
1
Parent(s):
1f6d536
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ def _concat_messages(messages):
|
|
17 |
raise ValueError("Invalid role: {}".format(message["role"]))
|
18 |
return message_text
|
19 |
|
20 |
-
endpoint_url =
|
21 |
client = Client(endpoint_url, timeout=120)
|
22 |
|
23 |
def generate_response(user_input, max_new_token: 100, top_p, temperature, top_k, do_sample, repetition_penalty):
|
@@ -31,9 +31,6 @@ def generate_response(user_input, max_new_token: 100, top_p, temperature, top_k,
|
|
31 |
return [("assistant", res.generated_text)]
|
32 |
|
33 |
with gr.Blocks() as demo:
|
34 |
-
# github_banner_path = 'https://raw.githubusercontent.com/ymcui/Chinese-LLaMA-Alpaca/main/pics/banner.png'
|
35 |
-
# gr.HTML(f'<p align="center"><a href="https://github.com/ymcui/Chinese-LLaMA-Alpaca"><img src={github_banner_path} width="700"/></a></p>')
|
36 |
-
# gr.Markdown("> 为了促进大模型在中文NLP社区的开放研究,本项目开源了中文LLaMA模型和指令精调的Alpaca大模型。这些模型在原版LLaMA的基础上扩充了中文词表并使用了中文数据进行二次预训练,进一步提升了中文基础语义理解能力。同时,中文Alpaca模型进一步使用了中文指令数据进行精调,显著提升了模型对指令的理解和执行能力。")
|
37 |
chatbot = gr.Chatbot()
|
38 |
with gr.Row():
|
39 |
with gr.Column(scale=4):
|
|
|
17 |
raise ValueError("Invalid role: {}".format(message["role"]))
|
18 |
return message_text
|
19 |
|
20 |
+
endpoint_url = os.environ.get("ENDPOINT_URL")
|
21 |
client = Client(endpoint_url, timeout=120)
|
22 |
|
23 |
def generate_response(user_input, max_new_token: 100, top_p, temperature, top_k, do_sample, repetition_penalty):
|
|
|
31 |
return [("assistant", res.generated_text)]
|
32 |
|
33 |
with gr.Blocks() as demo:
|
|
|
|
|
|
|
34 |
chatbot = gr.Chatbot()
|
35 |
with gr.Row():
|
36 |
with gr.Column(scale=4):
|