Spaces:
Runtime error
Runtime error
BeveledCube
commited on
Commit
•
a2422c2
1
Parent(s):
9cca841
Pls work
Browse files- .gitignore +2 -1
- Dockerfile +1 -5
- main.py +2 -2
- start.sh +5 -0
.gitignore
CHANGED
@@ -1,3 +1,4 @@
|
|
1 |
__pycache__
|
2 |
node_modules
|
3 |
-
poetry.lock
|
|
|
|
1 |
__pycache__
|
2 |
node_modules
|
3 |
+
poetry.lock
|
4 |
+
cache
|
Dockerfile
CHANGED
@@ -4,13 +4,9 @@ WORKDIR /api
|
|
4 |
|
5 |
COPY ./ /api/
|
6 |
|
7 |
-
RUN pip install --upgrade pip
|
8 |
-
RUN pip install -r requirements.txt
|
9 |
-
RUN poetry install --no-root
|
10 |
-
|
11 |
RUN mkdir /api/cache
|
12 |
RUN chmod a+rwx /api/cache
|
13 |
|
14 |
EXPOSE 7860
|
15 |
|
16 |
-
CMD ["
|
|
|
4 |
|
5 |
COPY ./ /api/
|
6 |
|
|
|
|
|
|
|
|
|
7 |
RUN mkdir /api/cache
|
8 |
RUN chmod a+rwx /api/cache
|
9 |
|
10 |
EXPOSE 7860
|
11 |
|
12 |
+
CMD ["bash", "start.sh"]
|
main.py
CHANGED
@@ -20,8 +20,8 @@ text = "a cat sitting on a table"
|
|
20 |
# Tokenize text and get features
|
21 |
inputs = clip_processor(text, return_tensors="pt", padding=True)
|
22 |
|
23 |
-
|
24 |
-
|
25 |
|
26 |
# Generate image from features
|
27 |
generated_image = clip_model.generate_images(image_features)
|
|
|
20 |
# Tokenize text and get features
|
21 |
inputs = clip_processor(text, return_tensors="pt", padding=True)
|
22 |
|
23 |
+
# Generate image features
|
24 |
+
image_features = clip_model.get_image_features(pixel_values=inputs.pixel_values)
|
25 |
|
26 |
# Generate image from features
|
27 |
generated_image = clip_model.generate_images(image_features)
|
start.sh
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
pip install --upgrade pip
|
2 |
+
pip install -r requirements.txt
|
3 |
+
poetry install --no-root
|
4 |
+
|
5 |
+
python main.py
|