Spaces:
Sleeping
Sleeping
update
Browse files- .idea/.gitignore +3 -0
- .idea/VQA-Server.iml +14 -0
- .idea/inspectionProfiles/Project_Default.xml +36 -0
- .idea/inspectionProfiles/profiles_settings.xml +6 -0
- .idea/misc.xml +4 -0
- .idea/modules.xml +8 -0
- .idea/vcs.xml +6 -0
- app.py +2 -3
- requirements.txt +0 -0
.idea/.gitignore
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
# Default ignored files
|
2 |
+
/shelf/
|
3 |
+
/workspace.xml
|
.idea/VQA-Server.iml
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<module type="PYTHON_MODULE" version="4">
|
3 |
+
<component name="NewModuleRootManager">
|
4 |
+
<content url="file://$MODULE_DIR$">
|
5 |
+
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
6 |
+
</content>
|
7 |
+
<orderEntry type="inheritedJdk" />
|
8 |
+
<orderEntry type="sourceFolder" forTests="false" />
|
9 |
+
</component>
|
10 |
+
<component name="PyDocumentationSettings">
|
11 |
+
<option name="format" value="PLAIN" />
|
12 |
+
<option name="myDocStringFormat" value="Plain" />
|
13 |
+
</component>
|
14 |
+
</module>
|
.idea/inspectionProfiles/Project_Default.xml
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<component name="InspectionProjectProfileManager">
|
2 |
+
<profile version="1.0">
|
3 |
+
<option name="myName" value="Project Default" />
|
4 |
+
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
5 |
+
<option name="ignoredPackages">
|
6 |
+
<value>
|
7 |
+
<list size="5">
|
8 |
+
<item index="0" class="java.lang.String" itemvalue="torch" />
|
9 |
+
<item index="1" class="java.lang.String" itemvalue="torchaudio" />
|
10 |
+
<item index="2" class="java.lang.String" itemvalue="tensorflow" />
|
11 |
+
<item index="3" class="java.lang.String" itemvalue="zenml" />
|
12 |
+
<item index="4" class="java.lang.String" itemvalue="mlflow" />
|
13 |
+
</list>
|
14 |
+
</value>
|
15 |
+
</option>
|
16 |
+
</inspection_tool>
|
17 |
+
<inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
18 |
+
<option name="ignoredErrors">
|
19 |
+
<list>
|
20 |
+
<option value="N814" />
|
21 |
+
<option value="N802" />
|
22 |
+
</list>
|
23 |
+
</option>
|
24 |
+
</inspection_tool>
|
25 |
+
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
26 |
+
<option name="ignoredIdentifiers">
|
27 |
+
<list>
|
28 |
+
<option value="list.__getitem__" />
|
29 |
+
<option value="db.database.get_db.users" />
|
30 |
+
<option value="firebase_admin._user_mgt.UserRecord.__await__" />
|
31 |
+
<option value="list.is_bold" />
|
32 |
+
</list>
|
33 |
+
</option>
|
34 |
+
</inspection_tool>
|
35 |
+
</profile>
|
36 |
+
</component>
|
.idea/inspectionProfiles/profiles_settings.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<component name="InspectionProjectProfileManager">
|
2 |
+
<settings>
|
3 |
+
<option name="USE_PROJECT_PROFILE" value="false" />
|
4 |
+
<version value="1.0" />
|
5 |
+
</settings>
|
6 |
+
</component>
|
.idea/misc.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<project version="4">
|
3 |
+
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11 (VQA-Server)" project-jdk-type="Python SDK" />
|
4 |
+
</project>
|
.idea/modules.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<project version="4">
|
3 |
+
<component name="ProjectModuleManager">
|
4 |
+
<modules>
|
5 |
+
<module fileurl="file://$PROJECT_DIR$/.idea/VQA-Server.iml" filepath="$PROJECT_DIR$/.idea/VQA-Server.iml" />
|
6 |
+
</modules>
|
7 |
+
</component>
|
8 |
+
</project>
|
.idea/vcs.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<project version="4">
|
3 |
+
<component name="VcsDirectoryMappings">
|
4 |
+
<mapping directory="" vcs="Git" />
|
5 |
+
</component>
|
6 |
+
</project>
|
app.py
CHANGED
@@ -12,10 +12,9 @@ app.add_middleware(
|
|
12 |
allow_methods=["*"], # Allows all methods
|
13 |
allow_headers=["*"], # Allows all headers
|
14 |
)
|
15 |
-
vqa_pipe = pipeline("visual-question-answering", model="Salesforce/blip-vqa-capfilt-large", tokenizer="Salesforce/blip-vqa-capfilt-large")
|
16 |
|
17 |
# Initialize the VQA pipeline
|
18 |
-
|
19 |
|
20 |
|
21 |
@app.post('/answer_question')
|
@@ -51,4 +50,4 @@ async def answer_question(image: UploadFile = File(...), question: str = Form(..
|
|
51 |
|
52 |
if __name__ == '__main__':
|
53 |
import uvicorn
|
54 |
-
uvicorn.run(app, host="0.0.0.0", port=8080)
|
|
|
12 |
allow_methods=["*"], # Allows all methods
|
13 |
allow_headers=["*"], # Allows all headers
|
14 |
)
|
|
|
15 |
|
16 |
# Initialize the VQA pipeline
|
17 |
+
vqa_pipe = pipeline("visual-question-answering", model="Salesforce/blip-vqa-capfilt-large", max_new_tokens=20)
|
18 |
|
19 |
|
20 |
@app.post('/answer_question')
|
|
|
50 |
|
51 |
if __name__ == '__main__':
|
52 |
import uvicorn
|
53 |
+
uvicorn.run(app, host="0.0.0.0", port=8080)
|
requirements.txt
CHANGED
Binary files a/requirements.txt and b/requirements.txt differ
|
|