|
|
--- |
|
|
language: |
|
|
- en |
|
|
license: mit |
|
|
library_name: transformers |
|
|
tags: |
|
|
- travel |
|
|
- itinerary |
|
|
- assistant |
|
|
- llama |
|
|
pipeline_tag: text-generation |
|
|
widget: |
|
|
- text: "Plan a 3-day trip to California starting on 15/04/2024" |
|
|
--- |
|
|
|
|
|
# ZenoBot Model - Hugging Face Deployment |
|
|
|
|
|
This folder contains the necessary files to deploy ZenoBot as a Hugging Face API service. |
|
|
|
|
|
## Files Overview |
|
|
|
|
|
- `modelfile`: Contains the system prompt and configuration for the model |
|
|
- `app.py`: FastAPI application that serves the model via HTTP API |
|
|
- `requirements.txt`: Python dependencies required to run the API |
|
|
- `Dockerfile`: Docker configuration for Hugging Face deployment |
|
|
- `space.yaml`: Configuration for Hugging Face Space |
|
|
|
|
|
## Deployment Options |
|
|
|
|
|
### 1. Hugging Face Deployment |
|
|
|
|
|
#### Using huggingface-cli |
|
|
|
|
|
The easiest way to upload your model to Hugging Face: |
|
|
|
|
|
1. Install the Hugging Face CLI: |
|
|
|
|
|
``` |
|
|
pip install -U "huggingface_hub[cli]" |
|
|
``` |
|
|
|
|
|
2. Login to Hugging Face: |
|
|
|
|
|
``` |
|
|
huggingface-cli login |
|
|
``` |
|
|
|
|
|
3. Upload your model files: |
|
|
``` |
|
|
huggingface-cli upload Zeno0007/zenobot . |
|
|
``` |
|
|
|
|
|
#### Alternative: Using Git |
|
|
|
|
|
1. Push this folder to a Hugging Face Space: |
|
|
|
|
|
``` |
|
|
git push huggingface main |
|
|
``` |
|
|
|
|
|
2. Configure the Hugging Face Space to use the Dockerfile |
|
|
|
|
|
## API Usage |
|
|
|
|
|
### Example Request |
|
|
|
|
|
```bash |
|
|
curl -X POST "https://your-huggingface-space-name.hf.space/generate" \ |
|
|
-H "Content-Type: application/json" \ |
|
|
-d '{ |
|
|
"query": "Plan a 3-day trip to California starting on 15/04/2024", |
|
|
"temperature": 0.1, |
|
|
"max_tokens": 2048 |
|
|
}' |
|
|
``` |
|
|
|
|
|
### Example Response |
|
|
|
|
|
```json |
|
|
{ |
|
|
"response": { |
|
|
"tripDetails": { |
|
|
"tripLengthHigh": false |
|
|
}, |
|
|
"itinerary": [ |
|
|
{ |
|
|
"dayStart": "[DayStart]", |
|
|
"date": "15/04/2024", |
|
|
"morningStart": "[MorningStart]", |
|
|
"morning": { |
|
|
"name": "Golden Gate Bridge Visit", |
|
|
"location": "San Francisco", |
|
|
"description": "Start your California adventure with a visit to the iconic Golden Gate Bridge. Walk or bike across the bridge for stunning views of the bay and city skyline.", |
|
|
"transportation": "Taxi" |
|
|
}, |
|
|
"afternoonStart": "[AfternoonStart]", |
|
|
"afternoon": { |
|
|
"name": "Alcatraz Island Tour", |
|
|
"location": "San Francisco Bay", |
|
|
"description": "Explore the historic Alcatraz Federal Penitentiary with an audio tour narrated by former inmates and guards.", |
|
|
"transportation": "Ferry" |
|
|
}, |
|
|
"eveningStart": "[EveningStart]", |
|
|
"evening": { |
|
|
"name": "Fisherman's Wharf Exploration", |
|
|
"location": "San Francisco", |
|
|
"description": "Enjoy the lively atmosphere of Fisherman's Wharf, watching sea lions at Pier 39 and taking in views of the bay.", |
|
|
"transportation": "Walking" |
|
|
}, |
|
|
"additionalActivityStart": "[AdditionalActivityStart]", |
|
|
"additionalActivity": { |
|
|
"name": "Cable Car Ride", |
|
|
"location": "San Francisco", |
|
|
"description": "Take a ride on San Francisco's historic cable cars for a unique way to experience the city's steep hills and views." |
|
|
}, |
|
|
"dayEnd": "[DayEnd]" |
|
|
} |
|
|
// Additional days... |
|
|
] |
|
|
} |
|
|
} |
|
|
``` |
|
|
|
|
|
## Environment Variables |
|
|
|
|
|
- `MODEL_ID`: Hugging Face model ID (default: meta-llama/Llama-3.2-3B-Instruct) |
|
|
- `PORT`: Port for the API server (default: 7860) |
|
|
|