metadata
title: Phi Finetuned Chat
emoji: π€
colorFrom: purple
colorTo: pink
sdk: docker
sdk_version: '3.10'
app_file: app.py
pinned: false
Simple Text Generator
A minimal Flask app for text generation with your fine-tuned model.
Features
- β Single page interface
- β Simple prompt β output
- β No complex questionnaire
- β Full terminal logging
- β Clean UI
- β Docker ready for Hugging Face Spaces
Files
app.py- Main Flask application (all-in-one file)requirements.txt- Python dependenciesDockerfile- Docker configuration for HF Spaces.dockerignore- Files to exclude from Docker build
Quick Deploy to Hugging Face Spaces
- Create new Space at https://huggingface.co/new-space
- Choose Docker as SDK (not Gradio or Streamlit)
- Upload all 4 files from this folder:
app.pyrequirements.txtDockerfile.dockerignore
- Wait for build to complete
- Access your app!
Local Usage
With Python directly:
pip install -r requirements.txt
python app.py
With Docker:
docker build -t simple-text-gen .
docker run -p 7860:7860 simple-text-gen
Configuration
Change model in app.py:
MODEL_NAME = "KASHH-4/phi_finetuned" # Your model
Adjust generation settings:
max_new_tokens=100 # Number of tokens to generate
do_sample=False # Greedy decoding (faster)
Hardware Requirements
- Minimum: 2 vCPU + 18GB RAM (CPU inference, ~60s per generation)
- Recommended: T4 GPU + 16GB RAM (GPU inference, ~3-5s per generation)