NassimeBejaia commited on
Commit
20287c3
·
verified ·
1 Parent(s): 98e8e0c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
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/chat/completions" # Updated endpoint
14
- HEADERS = {
15
- "Authorization": f"Bearer {DEEPSEEK_API_KEY}",
16
- "Content-Type": "application/json",
17
- "Accept": "application/json" # Added for clarity
 
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": 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
  }