Kedreamix / Linly-Talker

Digital Avatar Conversational System - Linly-Talker. 😄✨ Linly-Talker is an intelligent AI system that combines large language models (LLMs) with visual models to create a novel human-AI interaction method. 🤝🤖 It integrates various technologies like Whisper, Linly, Microsoft Speech Services, and SadTalker talking head generation system. 🌟🔬
https://kedreamix.github.io/
MIT License
1.27k stars 222 forks source link

请问如何连接ONEAPI,应当优化什么位置的代码 #39

Closed tt7day closed 1 month ago

tt7day commented 1 month ago

请问如何连接ONEAPI,应当优化什么位置的代码

Kedreamix commented 1 month ago

我觉得可以直接参考有关chatgpt和gemini部分的代码,在LLM文件夹下,主要是generate的函数

def generate(self, message):
        try:
            response = openai.ChatCompletion.create(
                model=self.model_path,
                messages=[
                    {"role": "user", "content": message}
                ]
            )
            return response['choices'][0]['message']['content']
        except Exception as e:
            print(e)
            return "对不起,你的请求出错了,请再次尝试。\nSorry, your request has encountered an error. Please try again.\n"