seawolf2357 commited on
Commit
a4d00f1
·
verified ·
1 Parent(s): b3c41e9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -5,7 +5,7 @@ import os
5
  # 환경 변수에서 Hugging Face API 토큰을 가져옵니다.
6
  ACCESS_TOKEN = os.getenv("HF_TOKEN")
7
 
8
- def respond(message, system_message="", max_tokens=512, temperature=0.7, top_p=0.95):
9
  # 메시지를 구성
10
  data = {
11
  "model": "command-r-plus:104b-fp16",
@@ -21,8 +21,8 @@ def respond(message, system_message="", max_tokens=512, temperature=0.7, top_p=0
21
 
22
  return generated_text # 생성된 텍스트 반환
23
 
24
- # Gradio ChatInterface 설정
25
- demo = gr.ChatInterface(
26
  fn=respond,
27
  inputs=[
28
  gr.Textbox(label="Your Message", placeholder="Type your message here..."),
@@ -31,6 +31,8 @@ demo = gr.ChatInterface(
31
  gr.Slider(minimum=0.1, maximum=1.0, value=0.95, label="Top-P")
32
  ],
33
  outputs=gr.Textbox(),
 
 
34
  theme="Nymbo/Nymbo_Theme"
35
  )
36
 
 
5
  # 환경 변수에서 Hugging Face API 토큰을 가져옵니다.
6
  ACCESS_TOKEN = os.getenv("HF_TOKEN")
7
 
8
+ def respond(message, max_tokens=512, temperature=0.7, top_p=0.95):
9
  # 메시지를 구성
10
  data = {
11
  "model": "command-r-plus:104b-fp16",
 
21
 
22
  return generated_text # 생성된 텍스트 반환
23
 
24
+ # Gradio 인터페이스 설정
25
+ demo = gr.Interface(
26
  fn=respond,
27
  inputs=[
28
  gr.Textbox(label="Your Message", placeholder="Type your message here..."),
 
31
  gr.Slider(minimum=0.1, maximum=1.0, value=0.95, label="Top-P")
32
  ],
33
  outputs=gr.Textbox(),
34
+ title="Advanced AI Chatbot",
35
+ description="Enter your message and receive a response generated by an advanced AI model.",
36
  theme="Nymbo/Nymbo_Theme"
37
  )
38