mhenrichsen commited on
Commit
ccebf8d
·
1 Parent(s): 67d8cc7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +21 -0
README.md CHANGED
@@ -60,6 +60,27 @@ eller som endpoint:
60
  ```
61
  python -m vllm.entrypoints.openai.api_server --model mhenrichsen/danskgpt-tiny-chat
62
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
 
64
 
65
  ## Training procedure
 
60
  ```
61
  python -m vllm.entrypoints.openai.api_server --model mhenrichsen/danskgpt-tiny-chat
62
  ```
63
+ og brugt som erstatning for OpenAI's endpoints:
64
+
65
+ ```python
66
+ from openai import OpenAI
67
+ openai_api_key = "EMPTY"
68
+ openai_api_base = "http://localhost:8000/v1"
69
+
70
+ client = OpenAI(
71
+ api_key=openai_api_key,
72
+ base_url=openai_api_base,
73
+ )
74
+
75
+ chat_response = client.chat.completions.create(
76
+ model="mhenrichsen/danskgpt-tiny-chat",
77
+ messages=[
78
+ {"role": "system", "content": "Du er en hjælpsom assistent. Giv mig et langt svar."},
79
+ {"role": "user", "content": "Fortæl mig om Danmark."},
80
+ ]
81
+ )
82
+ print("AI:", chat_response)
83
+ ```
84
 
85
 
86
  ## Training procedure