Update README.md
Browse files
README.md
CHANGED
@@ -17,8 +17,46 @@ datasets: jondurbin/airoboros-3.2
|
|
17 |
|
18 |
Prompt Template: ChatML
|
19 |
|
20 |
-
|
|
|
|
|
|
|
|
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
- **Developed by:** macadeliccc
|
24 |
- **License:** apache-2.0
|
|
|
17 |
|
18 |
Prompt Template: ChatML
|
19 |
|
20 |
+
```python
|
21 |
+
from openai import OpenAI
|
22 |
+
# Set OpenAI's API key and API base to use vLLM's API server.
|
23 |
+
openai_api_key = "EMPTY"
|
24 |
+
openai_api_base = "http://localhost:8000/v1"
|
25 |
|
26 |
+
client = OpenAI(
|
27 |
+
api_key=openai_api_key,
|
28 |
+
base_url=openai_api_base,
|
29 |
+
)
|
30 |
+
|
31 |
+
system = """
|
32 |
+
BEGININPUT
|
33 |
+
BEGINCONTEXT
|
34 |
+
date: 2021-01-01
|
35 |
+
url: https://web.site/123
|
36 |
+
ENDCONTEXT
|
37 |
+
In a shocking turn of events, blueberries are now green, but will be sticking with the same name.
|
38 |
+
ENDINPUT
|
39 |
+
BEGININSTRUCTION
|
40 |
+
{user}
|
41 |
+
ENDINSTRUCTION
|
42 |
+
"""
|
43 |
+
|
44 |
+
user = "What is the new color of blueberries?"
|
45 |
+
chat_response = client.chat.completions.create(
|
46 |
+
model="macadeliccc/airoboros-9b-3.2",
|
47 |
+
messages=[
|
48 |
+
{"role": "system", "content": system},
|
49 |
+
{"role": "user", "content": user},
|
50 |
+
]
|
51 |
+
)
|
52 |
+
print("Chat response:", chat_response)
|
53 |
+
```
|
54 |
+
## Expected Output
|
55 |
+
|
56 |
+
```
|
57 |
+
Chat response: ChatCompletion(id='cmpl-6bce7c051ffd41878624683faea90719', choices=[Choice(finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(content='Blueberries are now green.', role='assistant', function_call=None, tool_calls=None))], created=273292, model='macadeliccc/airoboros-9b-3.2', object='chat.completion', system_fingerprint=None, usage=CompletionUsage(completion_tokens=7, prompt_tokens=119, total_tokens=126))
|
58 |
+
|
59 |
+
```
|
60 |
|
61 |
- **Developed by:** macadeliccc
|
62 |
- **License:** apache-2.0
|