Spaces:
Runtime error
Runtime error
Commit History
scenario_name = """【{}】""".format(scenario) 475c2b5
scenario_name = """【{}】|""".format(scenario) 8b4a0e6
"交錯練習 Interleaving": "你是一個樂於助人的AI tutor,你會透過不斷提問的方式以確認我對這個主題的理解程度,請你透過 interleaving 策略,混合相關的觀念與知識,以幫助我以幫助我更理解及促進不同概念間的連結,你一次只問一個問題,你會先從prior knowledge開始你的問題,請向我提問關於 {} 的問題 " 9684a91
"交錯練習 Interleaving": "你是一個樂於助人的AI tutor,你會透過不斷提問的方式以確認我對這個主題: {} ,的理解程度,請你透過 interleaving 策略,混合相關的觀念與知識,以幫助我以幫助我更理解及促進不同概念間的連結,你一次只問一個問題,你會先從prior knowledge開始你的問題,請向我提問" 7d367ca
, style=btn_style 07d8380
with gr.Column(scale=1): dffef23
學習策略對話介面 05bb954
# print(output) # Debugging: Print the output format. 6defc64
gr.Markdown("## 學習策略 Learning Strategies") a42be51
with gr.Row(): ad5acc0
inputs=[chatbot, openai_key, chat_model], 8e98398
system_instruction = {"role": "system", "content": "You are a helpful AI tutor. Always communicate in Traditional Chinese. zh-TW,並且在反問時,不直接提供答案"} df7475d
if content: 0af21e4
history = history[-MAX_HISTORY_LENGTH:] 8ed3ff4
messages = [system_instruction] + [{"role": "user", "content": msg[0]} if not msg[1] else {"role": "assistant", "content": msg[1]} for msg in history[:-1]] fccd578
system_instruction = {"role": "system", "content": "You are a helpful AI tutor. Always communicate in Traditional Chinese. zh-TW"} 5194e18
def show_message(user_message, chatbot_history): 3a5dabe
{"role": "sys", "content": {"sys_param": {"language": "Zh-TW"}}}, # Add this line for system message. 028c40d
def show_message(user_message, chatbot_history): f20c8d1
def show_message(user_message, chatbot_history): e06cbc2
def handle_scenario(topic, scenario, chatbot_history=[]): baffaed
def handle_scenario(topic, scenario, chatbot_history=[]): 4481557
def handle_scenario(topic, scenario, chatbot_history=[]): 866e933
def handle_scenario(topic, scenario, chatbot_history): c18f4d6
available_models = ['gpt-4','gpt-3.5-turbo'] 6f8f9ee
for scenario in PROMPTS.keys(): 13241e1
MAX_WITHOUT_KEY = 30 671f063
PROMPTS ed15cb2
topic_input = gr.Textbox(label="主題", placeholder="輸入主題...") 6e33032
with gr.Row(): ddab20c
with gr.Row(): 53575d1
with gr.Column(scale=2): 62dfaa2
def show_message(user_message, chatbot_history): 5fcd3f4
debug 6efaff4
streaming_event_kwargs d0ff831
streaming_event_kwargs = dict( 35a7807
btn.click(lambda topic, chatbot_history: handle_scenario(topic, scenario, chatbot_history), [topic_input, chatbot], [chatbot], queue=False).then(**streaming_event_kwargs) bb3df01
uvicorn adff78b
uvicorn==0.15.0 ba51afc
# audio.stream e109b5b
for scenario in PROMPTS.keys(): 53235a0
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY") 272bf64
uvicorn==0.15.0 c0200ad
gradio==3.1.6 6600a9b
use_key = gr.Checkbox(label="Use OpenAI Key", default=True) 3099340
MAX_WITHOUT_KEY 422a4ed
gradio==3.30 541bd4e
gradio==3.29.0 2c92d42
update d8a3676
1lint commited on