Skip to content

Commit

Permalink
bump
Browse files Browse the repository at this point in the history
  • Loading branch information
jonafeucht committed Jun 8, 2024
1 parent 8976d65 commit 0ccd80d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fastapi[standard]==0.111.0
Pillow==10.3.0
transformers==4.40.1
torch==2.3.0
transformers==4.41.2
torch==2.3.1
python-dotenv==1.0.1
filetype==1.2.0
opencv-python-headless==4.9.0.80
Expand Down
21 changes: 13 additions & 8 deletions src/shared/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@


def check_model(model_name):
_model_name = model_name or default_model_name
try:
_model_name = model_name or default_model_name

classifier = pipeline(
"image-classification",
model=_model_name,
token=access_token,
device=device,
)
classifier = pipeline(
"image-classification",
model=_model_name,
token=access_token,
device=device,
)

return classifier
return classifier

except Exception as e:
print(e)
return {"error": str(e)}

0 comments on commit 0ccd80d

Please sign in to comment.