Upload app.py with huggingface_hub
Browse files1 unmodified line234567814 unmodified lines232425262728291 unmodified linefrom transformers import pipeline# Downloads & runs YOUR model directly on Hugging Face's big cloud server (0 MB on your PC!)ai_brain = pipeline("text-generation", model="Qwen/Qwen2.5-1.5B-Instruct", device_map="auto")def superbot_reply(message, history, uploaded_file):extra_context = ""14 unmodified linesmessages.append({"role": "user", "content": message + extra_context})result = ai_brain(messages, max_new_tokens=512)return result[0]["generated_text"][-1]["content"]demo = gr.ChatInterface(1 unmodified line234567814 unmodified lines232425262728291 unmodified linefrom transformers import pipeline# Downloads & runs YOUR model directly on Hugging Face's big cloud server (0 MB on your PC!)ai_brain = pipeline("text-generation", 1. model="Qwen/Qwen2.5-0.5B-Instruct")def superbot_reply(message, history, uploaded_file):extra_context = ""14 unmodified linesmessages.append({"role": "user", "content": message + extra_context})result = ai_brain(messages, max_new_tokens=150)return result[0]["generated_text"][-1]["content"]demo = gr.ChatInterface(
app.py+2-2