Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import torch
|
2 |
import re
|
3 |
import gradio as gr
|
4 |
from transformers import AutoTokenizer, ViTFeatureExtractor, VisionEncoderDecoderModel
|
5 |
import cohere
|
6 |
import os
|
7 |
-
|
8 |
-
|
9 |
key_srkian = os.environ["key_srkian"]
|
10 |
co = cohere.Client(key_srkian)#srkian
|
11 |
device='cpu'
|
@@ -49,7 +60,7 @@ def predict(department,image,max_length=64, num_beams=4):
|
|
49 |
|
50 |
|
51 |
|
52 |
-
output = gr.outputs.Textbox(type="
|
53 |
#examples = [f"example{i}.jpg" for i in range(1,7)]
|
54 |
#examples = os.listdir()
|
55 |
examples = [f"example{i}.png" for i in range(1,7)]
|
@@ -81,7 +92,4 @@ interface = gr.Interface(
|
|
81 |
description=description,
|
82 |
article = article,
|
83 |
)
|
84 |
-
interface.launch(debug=True)
|
85 |
-
|
86 |
-
|
87 |
-
# c0here2022
|
|
|
1 |
+
# %%bash
|
2 |
+
|
3 |
+
# # git lfs install
|
4 |
+
# # git clone https://huggingface.co/spaces/Xhaheen/meme_world
|
5 |
+
|
6 |
+
|
7 |
+
# # pip install -r /content/meme_world/requirements.txt
|
8 |
+
# # pip install gradio
|
9 |
+
# cd /meme_world
|
10 |
+
|
11 |
+
|
12 |
import torch
|
13 |
import re
|
14 |
import gradio as gr
|
15 |
from transformers import AutoTokenizer, ViTFeatureExtractor, VisionEncoderDecoderModel
|
16 |
import cohere
|
17 |
import os
|
18 |
+
#
|
19 |
+
# os.environ['key_srkian'] = ''
|
20 |
key_srkian = os.environ["key_srkian"]
|
21 |
co = cohere.Client(key_srkian)#srkian
|
22 |
device='cpu'
|
|
|
60 |
|
61 |
|
62 |
|
63 |
+
output = gr.outputs.Textbox(type="text",label="Meme")
|
64 |
#examples = [f"example{i}.jpg" for i in range(1,7)]
|
65 |
#examples = os.listdir()
|
66 |
examples = [f"example{i}.png" for i in range(1,7)]
|
|
|
92 |
description=description,
|
93 |
article = article,
|
94 |
)
|
95 |
+
interface.launch(debug=True)
|
|
|
|
|
|