th0mascat commited on
Commit
953ae8f
·
verified ·
1 Parent(s): 7410b55

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -23,7 +23,7 @@ configs = BaseModelConfigs.load("./configs.yaml")
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
 
@@ -95,8 +95,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")
99
- chatModel = T5ForConditionalGeneration.from_pretrained("grammarly/coedit-large")
100
 
101
  class ChatPrompt(BaseModel):
102
  prompt: str
 
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
 
 
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