Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,8 +8,8 @@ except ImportError:
|
|
8 |
os.system('pip install groq')
|
9 |
from groq import Groq
|
10 |
|
11 |
-
#
|
12 |
-
os.environ["GROQ_API_KEY"] = os.getenv("groq_key")
|
13 |
|
14 |
# 初始化 Groq 客戶端
|
15 |
client = Groq()
|
@@ -44,8 +44,8 @@ def chat_with_groq(user_input):
|
|
44 |
# 使用 Gradio 創建 chatbot
|
45 |
iface = gr.Interface(
|
46 |
fn=chat_with_groq,
|
47 |
-
inputs=gr.
|
48 |
-
outputs=gr.
|
49 |
title="國文老師 Chatbot",
|
50 |
description="這是一個專門批改國小作文的 Chatbot"
|
51 |
)
|
|
|
8 |
os.system('pip install groq')
|
9 |
from groq import Groq
|
10 |
|
11 |
+
# 設置 GROQ_API_KEY 環境變數
|
12 |
+
os.environ["GROQ_API_KEY"] = os.getenv("groq_key")
|
13 |
|
14 |
# 初始化 Groq 客戶端
|
15 |
client = Groq()
|
|
|
44 |
# 使用 Gradio 創建 chatbot
|
45 |
iface = gr.Interface(
|
46 |
fn=chat_with_groq,
|
47 |
+
inputs=gr.Textbox(label="請輸入您的問題:"), # 更新為新版 Gradio 語法
|
48 |
+
outputs=gr.Textbox(label="回應:"), # 更新為新版 Gradio 語法
|
49 |
title="國文老師 Chatbot",
|
50 |
description="這是一個專門批改國小作文的 Chatbot"
|
51 |
)
|