sijieaaa commited on
Commit
02f8f4f
·
verified ·
1 Parent(s): 0988d38

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -1,7 +1,7 @@
1
  # SPDX-License-Identifier: Apache-2.0
2
 
3
  import os
4
- os.system('nvcc --version')
5
  os.system('python --version')
6
 
7
 
@@ -17,6 +17,7 @@ import subprocess
17
 
18
  # Setup LLM API
19
  # -- llama-factory
 
20
  def start_api():
21
  # 以非阻塞方式启动 API
22
  process = subprocess.Popen(
@@ -36,7 +37,6 @@ def start_api():
36
  process.terminate()
37
  return None
38
  api_process = start_api()
39
- # API 启动后执行下一步
40
  if api_process:
41
  print("🎯 执行后续操作……")
42
  else:
@@ -47,6 +47,7 @@ else:
47
 
48
 
49
  # Setup OpenAI API client
 
50
  from openai import OpenAI
51
  openai_api_key = '0'
52
  openai_api_base = model_url
 
1
  # SPDX-License-Identifier: Apache-2.0
2
 
3
  import os
4
+ # os.system('nvcc --version')
5
  os.system('python --version')
6
 
7
 
 
17
 
18
  # Setup LLM API
19
  # -- llama-factory
20
+ os.system('git clone https://github.com/hiyouga/LLaMA-Factory.git && cd LLaMA-Factory && pip install -e . && cd ..')
21
  def start_api():
22
  # 以非阻塞方式启动 API
23
  process = subprocess.Popen(
 
37
  process.terminate()
38
  return None
39
  api_process = start_api()
 
40
  if api_process:
41
  print("🎯 执行后续操作……")
42
  else:
 
47
 
48
 
49
  # Setup OpenAI API client
50
+ os.system('pip install openai')
51
  from openai import OpenAI
52
  openai_api_key = '0'
53
  openai_api_base = model_url