update
Browse files- app.py +25 -2
- requirements.txt +1 -8
app.py
CHANGED
@@ -1,9 +1,32 @@
|
|
1 |
import gradio as gr
|
2 |
from gradio_multimodalchatbot import MultimodalChatbot
|
3 |
from gradio.data_classes import FileData
|
4 |
-
from backend import *
|
5 |
-
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
def multimodal_results(description_df):
|
8 |
conversation = []
|
9 |
for _, row in description_df.iterrows():
|
|
|
1 |
import gradio as gr
|
2 |
from gradio_multimodalchatbot import MultimodalChatbot
|
3 |
from gradio.data_classes import FileData
|
|
|
|
|
4 |
|
5 |
+
import subprocess
|
6 |
+
import sys
|
7 |
+
|
8 |
+
# Packages to install
|
9 |
+
packages = [
|
10 |
+
"--upgrade -q accelerate bitsandbytes",
|
11 |
+
"git+https://github.com/huggingface/transformers.git",
|
12 |
+
"datasets",
|
13 |
+
"gradio_multimodalchatbot",
|
14 |
+
"haversine",
|
15 |
+
"langchain"
|
16 |
+
]
|
17 |
+
|
18 |
+
# Function to install packages
|
19 |
+
def install_package(package):
|
20 |
+
try:
|
21 |
+
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
|
22 |
+
print(f"Successfully installed {package}")
|
23 |
+
except subprocess.CalledProcessError:
|
24 |
+
print(f"Failed to install {package}")
|
25 |
+
|
26 |
+
# Install packages at the beginning of the run
|
27 |
+
for package in packages:
|
28 |
+
install_package(package)
|
29 |
+
from backend import *
|
30 |
def multimodal_results(description_df):
|
31 |
conversation = []
|
32 |
for _, row in description_df.iterrows():
|
requirements.txt
CHANGED
@@ -1,9 +1,2 @@
|
|
1 |
-
huggingface_hub==0.22.2
|
2 |
-
accelerate
|
3 |
-
bitsandbytes
|
4 |
-
datasets
|
5 |
-
gradio_multimodalchatbot
|
6 |
-
haversine
|
7 |
-
langchain
|
8 |
-
transformers
|
9 |
spaces
|
|
|
1 |
+
huggingface_hub==0.22.2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
spaces
|