simple-ui / README.md
HusainHG's picture
Upload 5 files
0e86bf8 verified
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 dependencies
  • Dockerfile - Docker configuration for HF Spaces
  • .dockerignore - Files to exclude from Docker build

Quick Deploy to Hugging Face Spaces

  1. Create new Space at https://huggingface.co/new-space
  2. Choose Docker as SDK (not Gradio or Streamlit)
  3. Upload all 4 files from this folder:
    • app.py
    • requirements.txt
    • Dockerfile
    • .dockerignore
  4. Wait for build to complete
  5. Access your app!

Local Usage

With Python directly:

pip install -r requirements.txt
python app.py

Open http://localhost:7860

With Docker:

docker build -t simple-text-gen .
docker run -p 7860:7860 simple-text-gen

Open http://localhost:7860

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)