File size: 2,396 Bytes
09aa2b8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
sdk: gradio
sdk_version: 4.19.2
app_file: app.py
python_version: "3.10"

# Hardware requirements
hardware:
  cpu: 2
  memory: 16GB

# Build settings
build:
  cuda: "None" # No CUDA needed for CPU-only
  system_packages:
    - build-essential
    - python3-dev
    - cmake
    - pkg-config
    - libopenblas-dev
    - libomp-dev

# Environment variables
env:
  - MODEL_NAME=meta-llama/Llama-2-7b-chat-hf
  - EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
  - SECRET_KEY=${SECRET_KEY}
  - JWT_SECRET_KEY=${JWT_SECRET_KEY}
  - RATE_LIMIT_REQUESTS=100
  - RATE_LIMIT_WINDOW=3600
  - LOG_LEVEL=INFO

# Dependencies
dependencies:
  - gradio==4.19.2
  - langchain==0.1.9
  - langchain-core>=0.1.52,<0.2
  - langchain-community==0.0.27
  - langchain-text-splitters==0.0.1
  - langchain-huggingface==0.0.3
  - transformers==4.38.2
  - torch==2.2.1
  - accelerate==0.27.2
  - bitsandbytes==0.42.0
  - safetensors==0.4.2
  - sentence-transformers==2.6.1
  - faiss-cpu==1.7.4
  - pydantic==2.5.3
  - pydantic-settings==2.1.0
  - python-dotenv==1.0.0
  - fastapi==0.109.2
  - uvicorn==0.27.1
  - python-jose==3.3.0
  - passlib==1.7.4
  - python-multipart
  - bcrypt==4.1.2
  - httpx==0.26.0
  - aiohttp==3.9.5
  - tenacity==8.2.3
  - cachetools==5.3.2
  - numpy==1.26.3
  - tqdm==4.66.1
  - loguru==0.7.2
  - datasets==2.16.1
  - huggingface-hub==0.24.1
  - circuitbreaker==1.4.0

# Health check
health_check:
  path: /health
  interval: 300
  timeout: 10
  retries: 3

# Resource limits
resources:
  cpu: 2
  memory: 16GB

# Cache settings
cache:
  enabled: true
  ttl: 3600
  max_size: 1000

# Logging
logging:
  level: INFO
  format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
  handlers:
    - type: file
      filename: app.log
      max_bytes: 10485760
      backup_count: 5
    - type: stream
      stream: ext://sys.stdout

# Space settings
space:
  title: "TravelMate - AI Travel Assistant"
  description: "An AI-powered travel assistant using Llama-2 and RAG to help plan trips and provide travel information"
  license: mit
  sdk: gradio
  app_port: 7860
  app_url: "https://huggingface.co/spaces/bharadwaj-m/TravelMate-AI"

# Build commands
build:
  - pip install -r requirements.txt
  - mkdir -p data/vector_store data/user_profiles data/cache
  - python -c "from core.data_loader import DataLoader; DataLoader().initialize_knowledge_base()"

# Run command
run: python app.py