Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,13 +4,12 @@
|
|
4 |
import base64
|
5 |
import gradio as gr
|
6 |
from huggingface_hub import InferenceClient
|
7 |
-
from transformers import pipeline,AutoModelForCausalLM, AutoTokenizer
|
8 |
import torch
|
9 |
|
10 |
processor = AutoProcessor.from_pretrained("Qwen/Qwen2.5-VL-3B-Instruct")
|
11 |
model = AutoModelForImageTextToText.from_pretrained("Qwen/Qwen2.5-VL-3B-Instruct")
|
12 |
|
13 |
-
|
14 |
def chat(input_text, history=[]):
|
15 |
history.append(input_text)
|
16 |
prompt = "\n".join(history) + "\nAI:" # Simple conversational format
|
|
|
4 |
import base64
|
5 |
import gradio as gr
|
6 |
from huggingface_hub import InferenceClient
|
7 |
+
from transformers import pipeline,AutoModelForCausalLM, AutoProcessor, AutoTokenizer, AutoModelForImageTextToText
|
8 |
import torch
|
9 |
|
10 |
processor = AutoProcessor.from_pretrained("Qwen/Qwen2.5-VL-3B-Instruct")
|
11 |
model = AutoModelForImageTextToText.from_pretrained("Qwen/Qwen2.5-VL-3B-Instruct")
|
12 |
|
|
|
13 |
def chat(input_text, history=[]):
|
14 |
history.append(input_text)
|
15 |
prompt = "\n".join(history) + "\nAI:" # Simple conversational format
|