|
|
|
|
|
|
|
|
powershell -ExecutionPolicy ByPass -c "irm https://hf.co/cli/install.ps1 | iex" |
|
|
|
|
|
|
|
|
hf auth login |
|
|
|
|
|
|
|
|
hf upload RAAZIM/RT-AI . |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import gradio as gr |
|
|
from transformers import pipeline |
|
|
|
|
|
|
|
|
generator = pipeline("text-generation", model="EleutherAI/gpt-neo-1.3B") |
|
|
|
|
|
|
|
|
history = [] |
|
|
|
|
|
def chat(input_text): |
|
|
global history |
|
|
|
|
|
history.append(f"User: {input_text}") |
|
|
|
|
|
prompt = "\n".join(history) + "\nAI:" |
|
|
|
|
|
response = generator(prompt, max_length=200, do_sample=True, temperature=0.7) |
|
|
ai_text = response[0]["generated_text"] |
|
|
|
|
|
history.append(f"AI: {ai_text}") |
|
|
return ai_text |
|
|
|
|
|
|
|
|
iface = gr.Interface( |
|
|
fn=chat, |
|
|
inputs=gr.Textbox(lines=2, placeholder="Type your message here..."), |
|
|
outputs="text", |
|
|
title="AltisBot", |
|
|
description="Your free AI assistant chatbot" |
|
|
) |
|
|
|
|
|
|
|
|
iface.launch() |
|
|
unknown model type (must be text-to-speech or automatic-speech-recognition) |
|
|
|