Spaces:
Running
Running
chabane
commited on
Commit
·
c2bbc3a
1
Parent(s):
2cb2e14
modify the styles
Browse files
main.py
CHANGED
|
@@ -30,7 +30,7 @@ try:
|
|
| 30 |
print("[Info] installing Salesforce/blip-image-captioning-base ....")
|
| 31 |
blip_dir = "./models/blip-base-tf"
|
| 32 |
snapshot_download("Salesforce/blip-image-captioning-base", local_dir=blip_dir, local_dir_use_symlinks=False)
|
| 33 |
-
interpreter = pipeline("image-
|
| 34 |
print("[Info] Salesforce/blip-image-captioning-base is inatalled.")
|
| 35 |
except Exception as exp:
|
| 36 |
print("Can't load the model Salesforce/blip-image-captioning-base")
|
|
@@ -136,6 +136,8 @@ def summerzation(file:UploadFile=File(...)):
|
|
| 136 |
else:
|
| 137 |
return {"error": "Unsupported file type"}
|
| 138 |
|
|
|
|
|
|
|
| 139 |
result=""
|
| 140 |
global summarizer
|
| 141 |
for i in range(0, len(text), 1024):
|
|
|
|
| 30 |
print("[Info] installing Salesforce/blip-image-captioning-base ....")
|
| 31 |
blip_dir = "./models/blip-base-tf"
|
| 32 |
snapshot_download("Salesforce/blip-image-captioning-base", local_dir=blip_dir, local_dir_use_symlinks=False)
|
| 33 |
+
interpreter = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base")
|
| 34 |
print("[Info] Salesforce/blip-image-captioning-base is inatalled.")
|
| 35 |
except Exception as exp:
|
| 36 |
print("Can't load the model Salesforce/blip-image-captioning-base")
|
|
|
|
| 136 |
else:
|
| 137 |
return {"error": "Unsupported file type"}
|
| 138 |
|
| 139 |
+
print(f'[INFO] text_extracted : {text}' )
|
| 140 |
+
|
| 141 |
result=""
|
| 142 |
global summarizer
|
| 143 |
for i in range(0, len(text), 1024):
|