th0mascat commited on
Commit
9b30aaf
1 Parent(s): c7c76a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -22,9 +22,6 @@ configs = BaseModelConfigs.load("./configs.yaml")
22
 
23
  beam_settings = TTSettings(num_beams=5, min_length=1, max_length=100)
24
 
25
- import os
26
- os.environ['TRANSFORMERS_CACHE'] = 'cache/'
27
-
28
  app = FastAPI()
29
 
30
  origins = ["*"]
@@ -95,8 +92,8 @@ async def extract_text_from_image(image: UploadFile):
95
  from transformers import AutoTokenizer, T5ForConditionalGeneration
96
  from pydantic import BaseModel
97
 
98
- tokenizer = AutoTokenizer.from_pretrained("grammarly/coedit-large", cache_dir="cache/")
99
- chatModel = T5ForConditionalGeneration.from_pretrained("grammarly/coedit-large", cache_dir="cache/")
100
 
101
  class ChatPrompt(BaseModel):
102
  prompt: str
 
22
 
23
  beam_settings = TTSettings(num_beams=5, min_length=1, max_length=100)
24
 
 
 
 
25
  app = FastAPI()
26
 
27
  origins = ["*"]
 
92
  from transformers import AutoTokenizer, T5ForConditionalGeneration
93
  from pydantic import BaseModel
94
 
95
+ tokenizer = AutoTokenizer.from_pretrained("grammarly/coedit-large")
96
+ chatModel = T5ForConditionalGeneration.from_pretrained("grammarly/coedit-large")
97
 
98
  class ChatPrompt(BaseModel):
99
  prompt: str