YC-Chen commited on
Commit
824d560
1 Parent(s): 119dd92

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +27 -2
README.md CHANGED
@@ -40,8 +40,33 @@ The current release version of Breexe-8x7B is v0.1.
40
  Get started here:
41
 
42
  ```python
43
-
44
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  ```
46
 
47
  API service open time: 14:00 - 20:00 (from 2024/4/2 to 2024/5/3)
 
40
  Get started here:
41
 
42
  ```python
43
+ from openai import OpenAI
44
+
45
+ API_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoyLCJ1c2VybmFtZSI6ImdlbmVyYWxfcHVibGljIiwibm90ZSI6ImdlbmVyYWwgcHVibGljIn0.kCp68nRw3RSh3jbMm8FvhG0NIkStflgI1wTHLviRPQE"
46
+ BASE_URL = "https://api-mtkresearch.com/v1"
47
+ MODEL_NAME = "BreeXe-8x7B"
48
+
49
+ messages = [
50
+ {
51
+ 'role': 'system',
52
+ 'content': 'You are a helpful AI assistant built by MediaTek Research. The user you are helping speaks Traditional Chinese and comes from Taiwan.'
53
+ },
54
+ {
55
+ 'role': 'user',
56
+ 'content': '請問在量子物理領域中,疊加原理是什麼?它又是如何與量子糾纏現象相關聯的?'
57
+ }
58
+ ]
59
+
60
+ client = OpenAI(base_url=BASE_URL, api_key=API_KEY)
61
+ completion = client.chat.completions.create(
62
+ model=MODEL_NAME,
63
+ messages=messages,
64
+ temperature=0.01,
65
+ top_p=0.01,
66
+ max_tokens=512
67
+ )
68
+ response = completion.choices[0].message.content
69
+ print(response)
70
  ```
71
 
72
  API service open time: 14:00 - 20:00 (from 2024/4/2 to 2024/5/3)