chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
"""MLC Engine Python example."""
|
||||
|
||||
from mlc_llm import MLCEngine
|
||||
|
||||
# Create engine
|
||||
model = "HF://mlc-ai/Llama-3-8B-Instruct-q4f16_1-MLC"
|
||||
engine = MLCEngine(model)
|
||||
|
||||
# Run chat completion in OpenAI API.
|
||||
for response in engine.chat.completions.create(
|
||||
messages=[{"role": "user", "content": "What is the meaning of life?"}],
|
||||
model=model,
|
||||
stream=True,
|
||||
):
|
||||
for choice in response.choices:
|
||||
print(choice.delta.content, end="", flush=True)
|
||||
print("\n")
|
||||
|
||||
engine.terminate()
|
||||
Reference in New Issue
Block a user