Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| import requests | |
| API_URL = "https://api-inference.huggingface.co/models/TheBloke/MythoMax-L2-13B-GGUF" | |
| headers = {"Authorization": "Bearer TU_TOKEN_DE_HUGGINGFACE"} | |
| def responder(prompt): | |
| payload = { | |
| "inputs": prompt, | |
| "parameters": {"max_new_tokens": 200} | |
| } | |
| response = requests.post(API_URL, headers=headers, json=payload) | |
| try: | |
| return response.json()[0]["generated_text"] | |
| except: | |
| return "Error en la respuesta del modelo." | |
| iface = gr.Interface(fn=responder, inputs="text", outputs="text", title="MythoMax Chatbot") | |
| iface.launch() |