Spaces:
Sleeping
Sleeping
title: Zephyr For Mobile | |
emoji: 💬 | |
colorFrom: yellow | |
colorTo: purple | |
sdk: gradio | |
sdk_version: 5.42.0 | |
app_file: app.py | |
pinned: false | |
license: apache-2.0 | |
# 🤖 Zephyr-7B Chatbot for Mobile & Web | |
A lightweight **chatbot UI** built with [Gradio](https://gradio.app/) that connects to **Zephyr-7B** using the [Hugging Face Inference API](https://huggingface.co/docs/huggingface_hub/guides/inference). | |
Optimized for **mobile & desktop**, with adjustable parameters for creative or factual responses. | |
--- | |
## ✨ Features | |
- 📱 **Mobile-friendly UI** (works smoothly on phones & tablets) | |
- 💬 **Streaming responses** (token-by-token, like ChatGPT) | |
- ⚙️ Adjustable parameters: | |
- System prompt (role of the assistant) | |
- Max tokens | |
- Temperature | |
- Top-p (nucleus sampling) | |
- 🌐 Powered by **Hugging Face’s hosted inference API** (no need to run locally) | |
--- | |
## 🚀 Usage | |
1. Type your message in the input box. | |
2. Wait for the assistant to generate a response (it streams word by word). | |
3. Adjust the sliders (temperature, top-p, etc.) to change behavior. | |
--- | |
## 🛠️ Tech Stack | |
- [Gradio](https://gradio.app/) — UI framework | |
- [huggingface_hub](https://huggingface.co/docs/huggingface_hub) — model inference | |
- [Zephyr-7B](https://huggingface.co/HuggingFaceH4/zephyr-7b-beta) — instruction-tuned LLM | |
--- | |
## 📦 Installation (for local development) | |
Clone this repo and install dependencies: | |
```bash | |
git clone https://huggingface.co/spaces/Asilbek14/zephyr-for-mobile | |
cd zephyr-for-mobile | |
pip install -r requirements.txt | |
An example chatbot using [Gradio](https://gradio.app), [`huggingface_hub`](https://huggingface.co/docs/huggingface_hub/v0.22.2/en/index), and the [Hugging Face Inference API](https://huggingface.co/docs/api-inference/index). | |
What is Zephyr-7B? | |
Zephyr-7B is an open-source, 7-billion-parameter model developed by Hugging Face’s H4 team, fine-tuned from Mistral-7B using a method called distilled Direct Preference Optimization (dDPO). This alignment strategy, leveraging synthetic datasets and preference data, focused on helpfulness and surpasses traditional RLHF in producing aligned – and often superior – conversational results. Hugging Face arXiv | |
In benchmarks, Zephyr-7B-β scores 7.34 on MT-Bench and wins 90.6% in AlpacaEval, placing it at the top among 7B-chat models—and in some cases outperforming much larger open models, such as Llama2-Chat-70B. Hugging Face Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference | |
Capabilities: Translation, Summarization, Reasoning, Conclusions | |
These are areas where Zephyr-7B-β excels: | |
Summarization & translation: It’s explicitly recognized as strong in translating and summarizing tasks alongside writing and role-playing. Telnyx DataCamp | |
Reasoning & conclusions: Zephyr-7B-β shows strong conceptual understanding and is trained for intent alignment, enabling nuanced reasoning and drawing logical conclusions in many contexts. However, it may still trail behind proprietary giants in highly technical or math-heavy domains. Hugging Face Telnyx | |
Benchmarks: Its MT-Bench and AlpacaEval performance underscores its strong general reasoning. Hugging Face |