Download app_1.py from dtometzki/VL_AI: direct link, hf CLI and curl.
- Browser
- Download file 760 Bytes
-
https://huggingface.co/spaces/dtometzki/VL_AI/resolve/99f3f86ad6bb4692a697a48bfae4c73b0fbf7936/app_1.py
- Command line
-
hf download hf://spaces/dtometzki/VL_AI@99f3f86ad6bb4692a697a48bfae4c73b0fbf7936/app_1.py
-
curl -L -o app_1.py https://huggingface.co/spaces/dtometzki/VL_AI/resolve/99f3f86ad6bb4692a697a48bfae4c73b0fbf7936/app_1.py
760 Bytes
| # pip install -U gradio huggingface_hub | |
| import os | |
| import gradio as gr | |
| from huggingface_hub import InferenceClient | |
| MODEL_ID = "Qwen/Qwen3-Coder-Next" | |
| client = InferenceClient(model=MODEL_ID, token=os.environ.get("HF_TOKEN")) | |
| def chat(user_msg, history): | |
| messages = [] | |
| for u, a in history: | |
| messages += [{"role": "user", "content": u}, {"role": "assistant", "content": a}] | |
| messages.append({"role": "user", "content": user_msg}) | |
| # Server-side Chat Completions (je nach Backend/Provider) | |
| resp = client.chat.completions.create( | |
| messages=messages, | |
| max_tokens=512, | |
| temperature=0.2, | |
| ) | |
| return resp.choices[0].message["content"] | |
| gr.ChatInterface(chat, title="Qwen3-Coder-Next (HF Inference API)").launch() | |