Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ from PIL import Image, ImageChops, ImageFilter
|
|
4 |
from transformers import CLIPProcessor, CLIPModel, BlipProcessor, BlipForConditionalGeneration
|
5 |
import torch
|
6 |
import matplotlib.pyplot as plt
|
7 |
-
import numpy as np
|
8 |
|
9 |
# 初始化模型
|
10 |
clip_model = CLIPModel.from_pretrained("openai/clip-vit-base-patch32")
|
@@ -83,7 +83,7 @@ def generate_text_analysis(api_key, api_type, caption_a, caption_b):
|
|
83 |
else:
|
84 |
client = openai
|
85 |
|
86 |
-
response = client.
|
87 |
model="gpt-4" if api_type == "GPT" else "deepseek-chat",
|
88 |
messages=[
|
89 |
{"role": "system", "content": "You are a helpful assistant."},
|
|
|
4 |
from transformers import CLIPProcessor, CLIPModel, BlipProcessor, BlipForConditionalGeneration
|
5 |
import torch
|
6 |
import matplotlib.pyplot as plt
|
7 |
+
import numpy as np
|
8 |
|
9 |
# 初始化模型
|
10 |
clip_model = CLIPModel.from_pretrained("openai/clip-vit-base-patch32")
|
|
|
83 |
else:
|
84 |
client = openai
|
85 |
|
86 |
+
response = client.chat.completions.create(
|
87 |
model="gpt-4" if api_type == "GPT" else "deepseek-chat",
|
88 |
messages=[
|
89 |
{"role": "system", "content": "You are a helpful assistant."},
|