Views
No views yet
1from mlx_lm import load, generate
2
3# Load the model
4model, tokenizer = load("hebertgo/knowledgebase-intent-llm")
5
6# Generate intent classification
7prompt = '''You are a helpful AI assistant for a knowledge-management app on an iPhone. Analyze the user's request and respond with JSON in this format:
8{
9 "action": "Search|Create|Clarify|Conversation",
10 "response": "User-friendly response message",
11 "contentType": "videos|bookmarks|todos",
12 "topic": "extracted topic or null"
13}
14
15User query: find videos about python'''
16
17response = generate(model, tokenizer, prompt=prompt, max_tokens=256)
18print(response)1let config = ModelConfiguration(
2 id: "hebertgo/knowledgebase-intent-llm",
3 defaultPrompt: ""
4)
5
6let model = try await LLMModelFactory.shared.loadContainer(
7 configuration: config
8)