Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,7 +29,7 @@ footer {
|
|
| 29 |
# Functions
|
| 30 |
@spaces.GPU(duration=60)
|
| 31 |
def generate(image, instruction=DEFAULT_INPUT, sampling=False, temperature=0.7, top_p=0.8, top_k=100, repetition_penalty=1.05, max_tokens=512):
|
| 32 |
-
global
|
| 33 |
|
| 34 |
print(image)
|
| 35 |
# image_rgb = Image.open(image).convert("RGB")
|
|
@@ -46,8 +46,8 @@ def generate(image, instruction=DEFAULT_INPUT, sampling=False, temperature=0.7,
|
|
| 46 |
"max_new_tokens": max_tokens
|
| 47 |
}
|
| 48 |
|
| 49 |
-
output =
|
| 50 |
-
|
| 51 |
return output
|
| 52 |
|
| 53 |
def cloud():
|
|
|
|
| 29 |
# Functions
|
| 30 |
@spaces.GPU(duration=60)
|
| 31 |
def generate(image, instruction=DEFAULT_INPUT, sampling=False, temperature=0.7, top_p=0.8, top_k=100, repetition_penalty=1.05, max_tokens=512):
|
| 32 |
+
global repo, tokenizer
|
| 33 |
|
| 34 |
print(image)
|
| 35 |
# image_rgb = Image.open(image).convert("RGB")
|
|
|
|
| 46 |
"max_new_tokens": max_tokens
|
| 47 |
}
|
| 48 |
|
| 49 |
+
output = repo.chat(image=None, msgs=inputs, tokenizer=tokenizer, **parameters)
|
| 50 |
+
print(output)
|
| 51 |
return output
|
| 52 |
|
| 53 |
def cloud():
|