Spaces:
Running
A newer version of the Gradio SDK is available:
6.6.0
title: CS553 CaseStudy1
emoji: 💬
colorFrom: yellow
colorTo: purple
sdk: gradio
sdk_version: 6.5.1
python_version: 3.12.3
app_file: app.py
pinned: false
hf_oauth: true
hf_oauth_scopes:
- inference-api
license: mit
An Anime Recommendation chatbot using Gradio, huggingface_hub, and the Hugging Face Inference API.
Models Used by our Chatbot
| Type of Model | Model Name (Hugging Face Path) |
|---|---|
| Local Model | Qwen/Qwen3-0.6B |
| Inference Client Model | openai/gpt-oss-20b |
Working with UV (Ultra-Violet)
Install UV
Please download uv (Ultra-Violet) for Python Project Dependency Management: https://docs.astral.sh/uv/getting-started/installation/#installation-methods
Initializing a uv virtual env
Run following commands by navigating to the project directory:
cd /path/to/your/project
uv sync
Activating the virtual env
In the same project directory, execute the following (if virtual env is not already active):
source .venv/bin/activate
Adding any Libraries / Dependencies
To add any new dependencies (libraries):
uv add <library_name>
Working with HuggingFace Spaces Locally
Install Gradio with oAuth
Run the following command in your Python environment:
uv add "gradio[oauth]"
Set up HuggingFace Token
- Go to your HuggingFace profile at: https://huggingface.co/settings/tokens
- Generate a new token for your HuggingFace Space at
Create New Token->Fine-grained. - Under
Repository permissionssection, search for the repo: "spaces/MLDevOps/CS553_CaseStudy1" and select it - Check the box for "Write access to contents/settings of selected repos" and click "Create Token" at the bottom.
- Copy and Paste the generated token into a
.envfile in the root directory of your local copy of CS553_CaseStudy1 repo:
HF_TOKEN=XXXXXXXXX
- Login into HF:
hf auth login
Running Gradio App on HuggingFace Spaces Locally
Run the following command:
python app.py
It will spit out logs indicating the url to open in browser:
...
* Running on local URL: http://127.0.0.1:7860
...
Debugging Gradio Issue
In app.py, the line:
chatbot = gr.ChatInterface(
respond,
type="messages",
...
)
might need to be changed to remove the type line as follows due to a deprecation issue on HuggingFace Spaces:
chatbot = gr.ChatInterface(
respond,
...
)
With this, run the program and it should work locally on localhost server!