thedeba commited on
Commit
c65856a
·
verified ·
1 Parent(s): 1ff1004

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -2,6 +2,8 @@ from fastapi import FastAPI
2
  from pydantic import BaseModel
3
  from transformers import AutoModelForCausalLM, AutoTokenizer
4
  import torch
 
 
5
 
6
  # -------------------------------
7
  # Load model & tokenizer from HF Hub
@@ -16,6 +18,8 @@ device = "cpu" # Spaces free tier uses CPU; you can switch to "cuda" if GPU gra
16
  # FastAPI setup
17
  # -------------------------------
18
  app = FastAPI()
 
 
19
 
20
  class Query(BaseModel):
21
  text: str
 
2
  from pydantic import BaseModel
3
  from transformers import AutoModelForCausalLM, AutoTokenizer
4
  import torch
5
+ from fastapi.staticfiles import StaticFiles
6
+
7
 
8
  # -------------------------------
9
  # Load model & tokenizer from HF Hub
 
18
  # FastAPI setup
19
  # -------------------------------
20
  app = FastAPI()
21
+ app.mount("/", StaticFiles(directory="static", html=True), name="static")
22
+
23
 
24
  class Query(BaseModel):
25
  text: str