Spaces:
Running
Running
import SpaceFace as sf | |
import GPTSimple as ai | |
class AIEndpoint: | |
def receivedMessage(self, message, user: sf.User, responder: sf.Responder): | |
if hasattr(user, 'chat'): | |
responder.respond(user.chat.ask(message)) | |
else: | |
chat = ai.conversation(base_url="deepinfra", model="meta-llama/Llama-3.2-90B-Vision-Instruct") | |
responder.respond(user.chat.ask(message)) | |
responder.close() | |
sf.start_server([AIEndpoint()]) |