Spaces:
Sleeping
Sleeping
aichatbot
#1
by
AptlyDigital
- opened
- README.md +7 -22
- app.py +0 -32
- requirements.txt +0 -6
README.md
CHANGED
|
@@ -1,29 +1,14 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 6.3.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
-
license:
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
A conversational AI chatbot built with Gradio and Microsoft's DialoGPT model.
|
| 16 |
-
|
| 17 |
-
## Features
|
| 18 |
-
- Interactive chat interface with conversation history
|
| 19 |
-
- Powered by DialoGPT-medium for natural conversations
|
| 20 |
-
- Clean, responsive Gradio UI
|
| 21 |
-
- Easy to customize and extend
|
| 22 |
-
|
| 23 |
-
## Model Information
|
| 24 |
-
This chatbot uses [microsoft/DialoGPT-medium](https://huggingface.co/microsoft/DialoGPT-medium), a 345M parameter conversational AI model trained on Reddit discussions.
|
| 25 |
-
|
| 26 |
-
## Local Development
|
| 27 |
-
```bash
|
| 28 |
-
pip install -r requirements.txt
|
| 29 |
-
python app.py
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Simpleai
|
| 3 |
+
emoji: 💻
|
| 4 |
+
colorFrom: yellow
|
| 5 |
+
colorTo: pink
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 6.3.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
+
license: apache-2.0
|
| 11 |
+
short_description: simple chatbot
|
| 12 |
---
|
| 13 |
|
| 14 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.py
DELETED
|
@@ -1,32 +0,0 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
from transformers import pipeline
|
| 3 |
-
|
| 4 |
-
chatbot = pipeline("text-generation", model="Qwen/Qwen2.5-0.5B-Instruct", trust_remote_code=True)
|
| 5 |
-
|
| 6 |
-
def respond(message, history):
|
| 7 |
-
"""Simplified response function"""
|
| 8 |
-
prompt = ""
|
| 9 |
-
for msg in history:
|
| 10 |
-
prompt += f"{msg['role'].capitalize()}: {msg['content']}\n"
|
| 11 |
-
|
| 12 |
-
prompt += f"Human: {message}\nAssistant:"
|
| 13 |
-
|
| 14 |
-
response = chatbot(prompt, max_new_tokens=100)[0]['generated_text']
|
| 15 |
-
return response.split("Assistant:")[-1].strip()
|
| 16 |
-
|
| 17 |
-
# Simple interface with voice
|
| 18 |
-
with gr.Blocks() as demo:
|
| 19 |
-
gr.Markdown("# 🎤 Voice AI Assistant")
|
| 20 |
-
|
| 21 |
-
# Chat interface
|
| 22 |
-
chat_interface = gr.ChatInterface(
|
| 23 |
-
fn=respond,
|
| 24 |
-
title="AI Chat",
|
| 25 |
-
description="Type or use voice input"
|
| 26 |
-
)
|
| 27 |
-
|
| 28 |
-
# Add voice input
|
| 29 |
-
with gr.Row():
|
| 30 |
-
audio = gr.Audio(sources=["microphone"], type="filepath", label="Voice Input")
|
| 31 |
-
|
| 32 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
DELETED
|
@@ -1,6 +0,0 @@
|
|
| 1 |
-
gradio>=4.36.0
|
| 2 |
-
transformers>=4.38.0
|
| 3 |
-
torch>=2.2.0
|
| 4 |
-
accelerate>=0.27.0
|
| 5 |
-
openai-whisper
|
| 6 |
-
ffmpeg-python
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|