Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,12 +10,14 @@ DEEPSEEK_API_KEY = os.getenv("DEEPSEEK_API_KEY")
|
|
10 |
# API endpoint for DeepSeek
|
11 |
#DEEPSEEK_API_URL = "https://api.deepseek.com/chat/completions"
|
12 |
|
13 |
-
DEEPSEEK_API_URL = "https://api.deepseek.com/v1/
|
14 |
-
|
15 |
-
"
|
16 |
-
"
|
17 |
-
"
|
|
|
18 |
}
|
|
|
19 |
|
20 |
HEADERS = {"Authorization": f"Bearer {DEEPSEEK_API_KEY}", "Content-Type": "application/json"}
|
21 |
|
@@ -37,7 +39,7 @@ if st.button("Improve Sentence"):
|
|
37 |
prompt = f"Correct and improve this sentence: '{user_input}'"
|
38 |
payload = {
|
39 |
"model": "deepseek-coder", # Adjust if you have a specific DeepSeek model in mind
|
40 |
-
"prompt":
|
41 |
"max_tokens": 100,
|
42 |
"temperature": 0.7
|
43 |
}
|
|
|
10 |
# API endpoint for DeepSeek
|
11 |
#DEEPSEEK_API_URL = "https://api.deepseek.com/chat/completions"
|
12 |
|
13 |
+
DEEPSEEK_API_URL = "https://api.deepseek.com/v1/completions"
|
14 |
+
payload = {
|
15 |
+
"model": "deepseek-coder",
|
16 |
+
"prompt": prompt_content,
|
17 |
+
"max_tokens": 150,
|
18 |
+
"temperature": 0.7
|
19 |
}
|
20 |
+
# Parse as response.json()["choices"][0]["text"]
|
21 |
|
22 |
HEADERS = {"Authorization": f"Bearer {DEEPSEEK_API_KEY}", "Content-Type": "application/json"}
|
23 |
|
|
|
39 |
prompt = f"Correct and improve this sentence: '{user_input}'"
|
40 |
payload = {
|
41 |
"model": "deepseek-coder", # Adjust if you have a specific DeepSeek model in mind
|
42 |
+
"prompt": prompt_content,
|
43 |
"max_tokens": 100,
|
44 |
"temperature": 0.7
|
45 |
}
|