Spaces:
Runtime error
Runtime error
Download app.py from Publicityvisual/novaaichatbot: direct link, hf CLI and curl.
- Browser
- Download file 825 Bytes
-
https://huggingface.co/spaces/Publicityvisual/novaaichatbot/resolve/main/app.py
- Command line
-
hf download hf://spaces/Publicityvisual/novaaichatbot/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Publicityvisual/novaaichatbot/resolve/main/app.py
825 Bytes
| import gradio as gr | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| import torch | |
| # Cargar modelo NovaAI desde Hugging Face público | |
| model = AutoModelForCausalLM.from_pretrained("Publicityvisual/novai") | |
| tokenizer = AutoTokenizer.from_pretrained("Publicityvisual/novai") | |
| # Función de conversación | |
| def nova_chat(message, history=[]): | |
| inputs = tokenizer(message, return_tensors="pt") | |
| outputs = model.generate(**inputs, max_new_tokens=150, pad_token_id=tokenizer.eos_token_id) | |
| response = tokenizer.decode(outputs[0], skip_special_tokens=True) | |
| return response | |
| # Interfaz Gradio | |
| gr.ChatInterface( | |
| fn=nova_chat, | |
| title="🤖 NovaAI – La Inteligencia Total", | |
| description="Conversación con la IA ética, autosuficiente y leal creada por DJ KOVECK", | |
| theme="darkmonochrome" | |
| ).launch() | |