jzhang533 commited on
Commit
372b193
·
1 Parent(s): 8cfb246

using ernie 4.5 turbo

Browse files

Signed-off-by: Zhang Jun <jzhang533@gmail.com>

Files changed (2) hide show
  1. README.md +2 -3
  2. app.py +4 -4
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: ERNIE 4.5
3
  emoji: 💬
4
  colorFrom: yellow
5
  colorTo: purple
@@ -8,7 +8,6 @@ sdk_version: 5.0.1
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
11
- short_description: ERNIE 4.5 (BAIDU's LLM), https://yiyan.baidu.com/
12
  ---
13
 
14
- An example chatbot using [Gradio](https://gradio.app), [`huggingface_hub`](https://huggingface.co/docs/huggingface_hub/v0.22.2/en/index), and the [Hugging Face Inference API](https://huggingface.co/docs/api-inference/index).
 
1
  ---
2
+ title: ERNIE 4.5 Turbo and ERNIE X1 Turbo
3
  emoji: 💬
4
  colorFrom: yellow
5
  colorTo: purple
 
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
11
+ short_description: BAIDU's LLM, https://yiyan.baidu.com/
12
  ---
13
 
 
app.py CHANGED
@@ -3,16 +3,16 @@ import gradio as gr
3
  from openai import OpenAI
4
 
5
 
6
- title = "ERNIE 4.5 : BAIDU's LLM"
7
  description = """
8
  - Official Website: <https://yiyan.baidu.com/> (UI in Chinese)
9
- - Twitter post: [We've just unveiled ERNIE 4.5 & X1! 🚀](https://x.com/Baidu_Inc/status/1901089355890036897)
10
  - API services: [Qianfan Large Model Platform](https://cloud.baidu.com/product-s/qianfan_home) (cloud platform providing LLM services, UI in Chinese)
11
  """
12
 
13
 
14
  qianfan_api_key = os.getenv("QIANFAN_TOKEN")
15
- qianfan_model = "ernie-4.5-8k-preview"
 
16
 
17
  client = OpenAI(base_url="https://qianfan.baidubce.com/v2", api_key=qianfan_api_key)
18
 
@@ -55,7 +55,7 @@ demo = gr.ChatInterface(
55
  respond,
56
  additional_inputs=[
57
  gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
58
- gr.Slider(minimum=2, maximum=2048, value=512, step=1, label="Max new tokens"),
59
  gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Temperature"),
60
  gr.Slider(
61
  minimum=0.1,
 
3
  from openai import OpenAI
4
 
5
 
6
+ title = "EERNIE 4.5 Turbo and ERNIE X1 Turbo : BAIDU's LLM"
7
  description = """
8
  - Official Website: <https://yiyan.baidu.com/> (UI in Chinese)
 
9
  - API services: [Qianfan Large Model Platform](https://cloud.baidu.com/product-s/qianfan_home) (cloud platform providing LLM services, UI in Chinese)
10
  """
11
 
12
 
13
  qianfan_api_key = os.getenv("QIANFAN_TOKEN")
14
+ #qianfan_model = "ernie-4.5-8k-preview"
15
+ qianfan_model = "ernie-4.5-turbo-32k"
16
 
17
  client = OpenAI(base_url="https://qianfan.baidubce.com/v2", api_key=qianfan_api_key)
18
 
 
55
  respond,
56
  additional_inputs=[
57
  gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
58
+ gr.Slider(minimum=2, maximum=12288, value=2048, step=1, label="Max new tokens"),
59
  gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Temperature"),
60
  gr.Slider(
61
  minimum=0.1,