Amish Kushwaha commited on
Commit
6d2a9d7
·
1 Parent(s): 3cc890e

Fix transformer cache issue

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -1,7 +1,11 @@
 
1
  from fastapi import FastAPI
2
  from pydantic import BaseModel
3
  from transformers import pipeline
4
 
 
 
 
5
  # Load your Hugging Face model
6
  model = pipeline("text-generation", model="devops-bda/Abap")
7
 
 
1
+ import os
2
  from fastapi import FastAPI
3
  from pydantic import BaseModel
4
  from transformers import pipeline
5
 
6
+ # Set cache directory to a writable location
7
+ os.environ["TRANSFORMERS_CACHE"] = "/app/cache"
8
+
9
  # Load your Hugging Face model
10
  model = pipeline("text-generation", model="devops-bda/Abap")
11