CoolFace
Apppublic

Amybiotech/Career-Options_MN

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
5 commits on main
db769be1y ago

Create requirements.txt

Amybiotech
265a6391y ago

Update app.py

Amybiotech
496f4ec1y ago

import gradio as gr from huggingface_hub import InferenceClient # Hugging Face inference client (түлхүүрээ тохируулна) client = InferenceClient("HuggingFaceH4/zephyr-7b-beta") # жишээ загвар system_prompt = """Та бол Монгол хэл дээр зөвлөгөө өгдөг мэргэжлийн зөвлөх чатбот. Хэрэглэгчийн сонирхол, чадвар, дуртай хичээл зэргийг уншаад тохирох мэргэжлийг санал болгоно. Богино, ойлгомжтой, урам зориг өгсөн байдлаар хариул. """ def career_advice(user_input, history): # Chat history-г хадгална messages = [{"role": "system", "content": system_prompt}] for human, assistant in history: messages.append({"role": "user", "content": human}) messages.append({"role": "assistant", "content": assistant}) messages.append({"role": "user", "content": user_input}) # AI-аас хариулт авах response = client.chat.completions.create( model="HuggingFaceH4/zephyr-7b-beta", messages=messages, max_tokens=200, temperature=0.7 ) bot_reply = response.choices[0].message["content"] history.append((user_input, bot_reply)) return "", history with gr.Blocks() as demo: gr.Markdown("## 🎓 Мэргэжлийн зөвлөх чатбот (AI хувилбар)\nСонирхол, чадвараа бичээд тохирох мэргэжлийн зөвлөмж аваарай.") chatbot = gr.Chatbot() msg = gr.Textbox(label="Та өөрийн сонирхол, чадвараа бичээрэй:") msg.submit(career_advice, [msg, chatbot], [msg, chatbot]) if __name__ == "__main__": demo.launch()

Amybiotech
50f14401y ago

initial commit

Amybiotech
b3dc3611y ago

Duplicate from gradio-templates/chatbot

Amybiotech, pngwn