Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
from transformers import
|
2 |
import torch
|
3 |
from PIL import Image
|
4 |
import requests
|
@@ -11,7 +11,7 @@ import time
|
|
11 |
processor = ChameleonProcessor.from_pretrained("facebook/chameleon-30b")
|
12 |
model = ChameleonForConditionalGeneration.from_pretrained("facebook/chameleon-30b", torch_dtype=torch.float16).to("cuda")
|
13 |
|
14 |
-
|
15 |
def bot_streaming(message, history):
|
16 |
|
17 |
txt = message.text
|
|
|
1 |
+
from transformers import TextIteratorStreamer, ChameleonForConditionalGeneration, ChameleonProcessor
|
2 |
import torch
|
3 |
from PIL import Image
|
4 |
import requests
|
|
|
11 |
processor = ChameleonProcessor.from_pretrained("facebook/chameleon-30b")
|
12 |
model = ChameleonForConditionalGeneration.from_pretrained("facebook/chameleon-30b", torch_dtype=torch.float16).to("cuda")
|
13 |
|
14 |
+
@spaces.GPU
|
15 |
def bot_streaming(message, history):
|
16 |
|
17 |
txt = message.text
|