Upload 5 files
Browse files- Dockerfile +17 -0
- README.md +34 -10
- Space.yaml +7 -0
- runtime.txt +1 -0
Dockerfile
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use a Python base image
|
2 |
+
FROM python:3.9-slim
|
3 |
+
|
4 |
+
# Set working directory
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Copy all project files to the container
|
8 |
+
COPY . .
|
9 |
+
|
10 |
+
# Install Python dependencies
|
11 |
+
RUN pip install -r requirements.txt
|
12 |
+
|
13 |
+
# Expose the port Flask will run on (required by Hugging Face Spaces)
|
14 |
+
EXPOSE 5000
|
15 |
+
|
16 |
+
# Run the Flask app
|
17 |
+
CMD ["python", "app.py"]
|
README.md
CHANGED
@@ -1,10 +1,34 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Little Krishna Chatbot
|
2 |
+
|
3 |
+
A birthday gift for Manavi, powered by Flask, Gemma, Stable Diffusion, and Firebase.
|
4 |
+
|
5 |
+
## Overview
|
6 |
+
This app creates a Little Krishna-themed chatbot for Manavi’s birthday on April 19, 2025. It features:
|
7 |
+
- A chatbot powered by Gemma (via Hugging Face Inference API).
|
8 |
+
- Krishna-themed images generated by Stable Diffusion (via Hugging Face Inference API).
|
9 |
+
- Chat history stored in Firebase Realtime Database.
|
10 |
+
- A countdown to Manavi’s birthday.
|
11 |
+
- A birthday message page with a generated image and animation.
|
12 |
+
|
13 |
+
## Setup
|
14 |
+
1. **Secrets**:
|
15 |
+
- Add the following secrets in Hugging Face Space Settings > Secrets:
|
16 |
+
- `HUGGINGFACE_API_TOKEN`: Your Hugging Face API token (read access).
|
17 |
+
- `FIREBASE_PROJECT_ID`: `birthday-d1e31`
|
18 |
+
- `FIREBASE_PRIVATE_KEY_ID`: `101cfdd51115184fd9d6ee189b2264420c0ce015`
|
19 |
+
- `FIREBASE_PRIVATE_KEY`: (Your Firebase private key, multi-line)
|
20 |
+
- `FIREBASE_CLIENT_EMAIL`: `[email protected]`
|
21 |
+
- `FIREBASE_CLIENT_ID`: `113359261182405536589`
|
22 |
+
- `FIREBASE_CLIENT_X509_CERT_URL`: `https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-fbsvc%40birthday-d1e31.iam.gserviceaccount.com`
|
23 |
+
- `FIREBASE_DATABASE_URL`: `https://birthday-d1e31-default-rtdb.firebaseio.com/`
|
24 |
+
|
25 |
+
2. **Hardware**:
|
26 |
+
- Use the CPU basic tier (2 vCPU, 16 GB, free) in Hugging Face Space Settings.
|
27 |
+
|
28 |
+
3. **Restart Space**:
|
29 |
+
- After adding files and secrets, restart the Space to deploy the app.
|
30 |
+
|
31 |
+
## Usage
|
32 |
+
- **Home Page**: See the countdown to Manavi’s birthday and a Krishna animation.
|
33 |
+
- **Chat Page**: Chat with Little Krishna and generate a comic strip by saying “Tell me a story!”
|
34 |
+
- **Birthday Message Page**: View a generated Krishna image and Ayush’s birthday message for Manavi.
|
Space.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
title: Little Krishna Chatbot
|
2 |
+
emoji: 🦚
|
3 |
+
colorFrom: blue
|
4 |
+
colorTo: yellow
|
5 |
+
sdk: docker
|
6 |
+
app_file: app.py
|
7 |
+
app_port: 5000
|
runtime.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
3.9
|