Skip to content

Commit c3d7be2

Browse files
authored
Merge pull request #141 from leordsong/main
Support deepseek v3
2 parents 13e84ec + e33591d commit c3d7be2

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

funclip/launch.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ def video_clip_addsub(dest_text, video_spk_input, start_ost, end_ost, state, out
117117
)
118118

119119
def llm_inference(system_content, user_content, srt_text, model, apikey):
120-
SUPPORT_LLM_PREFIX = ['qwen', 'gpt', 'g4f', 'moonshot']
120+
SUPPORT_LLM_PREFIX = ['qwen', 'gpt', 'g4f', 'moonshot', 'deepseek']
121121
if model.startswith('qwen'):
122122
return call_qwen_model(apikey, model, user_content+'\n'+srt_text, system_content)
123-
if model.startswith('gpt') or model.startswith('moonshot'):
123+
if model.startswith('gpt') or model.startswith('moonshot') or model.startswith('deepseek'):
124124
return openai_call(apikey, model, system_content, user_content+'\n'+srt_text)
125125
elif model.startswith('g4f'):
126126
model = "-".join(model.split('-')[1:])
@@ -210,12 +210,14 @@ def AI_clip_subti(LLM_res, dest_text, video_spk_input, start_ost, end_ost, video
210210
with gr.Column():
211211
with gr.Row():
212212
llm_model = gr.Dropdown(
213-
choices=["qwen-plus",
213+
choices=[
214+
"deepseek-chat"
215+
"qwen-plus",
214216
"gpt-3.5-turbo",
215217
"gpt-3.5-turbo-0125",
216218
"gpt-4-turbo",
217219
"g4f-gpt-3.5-turbo"],
218-
value="qwen-plus",
220+
value="deepseek-chat",
219221
label="LLM Model Name",
220222
allow_custom_value=True)
221223
apikey_input = gr.Textbox(label="APIKEY")

funclip/llm/openai_api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,15 @@ def openai_call(apikey,
2626
model="gpt-3.5-turbo",
2727
user_content="如何做西红柿炖牛腩?",
2828
system_content=None):
29+
base_url = None
30+
if model.startswith("deepseek"):
31+
base_url = "https://api.deepseek.com"
32+
elif model.startswith("gpt-3.5-turbo"):
33+
base_url = "https://api.moonshot.cn/v1"
2934
client = OpenAI(
3035
# This is the default and can be omitted
3136
api_key=apikey,
37+
base_url=base_url
3238
)
3339
if system_content is not None and len(system_content.strip()):
3440
messages = [

0 commit comments

Comments
 (0)