Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from huggingface_hub import InferenceClient | |
| import os | |
| HF_TOKEN = os.getenv("HF_TOKEN") | |
| client = InferenceClient("deepcogito/cogito-v2-preview-llama-109B-MoE") | |
| def chat(prompt): | |
| try: | |
| output = client.chat_completion(prompt) | |
| return output | |
| except Exception as e: | |
| return f"Error: {e}" | |
| gr.Interface( | |
| fn=chat, | |
| inputs="text", | |
| outputs="text", | |
| title="💬 Cogito Chat Demo", | |
| description="Runs Cogito remotely via Hugging Face's free API (no download)." | |
| ).launch() | |