Miaoran000 commited on
Commit
6c3a616
·
2 Parent(s): 5c4aa1e a219d3f

merge with 'main'

Browse files
Files changed (2) hide show
  1. README.md +2 -2
  2. src/backend/model_operations.py +2 -2
README.md CHANGED
@@ -4,12 +4,12 @@ emoji: 🥇
4
  colorFrom: green
5
  colorTo: indigo
6
  sdk: gradio
7
- sdk_version: 4.4.0
8
  app_file: app.py
9
  pinned: true
10
  license: apache-2.0
11
  tags:
12
- - leaderboard
13
  ---
14
 
15
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
4
  colorFrom: green
5
  colorTo: indigo
6
  sdk: gradio
7
+ sdk_version: 4.37.1
8
  app_file: app.py
9
  pinned: true
10
  license: apache-2.0
11
  tags:
12
+ - leaderboard
13
  ---
14
 
15
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
src/backend/model_operations.py CHANGED
@@ -328,7 +328,7 @@ class SummaryGenerator:
328
  try: # try use HuggingFace API
329
  print('using huggingface api')
330
  response = litellm.completion(
331
- model='command-r-plus' if 'command' in self.model else self.model,
332
  messages=[{"role": "system", "content": system_prompt},
333
  {"role": "user", "content": user_prompt}],
334
  temperature=0.0,
@@ -347,7 +347,7 @@ class SummaryGenerator:
347
  else:
348
  self.tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-hf" if 'openelm' in self.model_id.lower() else self.model_id, trust_remote_code=True)
349
  print("Tokenizer loaded")
350
- self.local_model = AutoModelForCausalLM.from_pretrained(self.model_id, trust_remote_code=True, device_map="auto", torch_dtype="auto")
351
  print("Local model loaded")
352
 
353
  # Using local model
 
328
  try: # try use HuggingFace API
329
  print('using huggingface api')
330
  response = litellm.completion(
331
+ model='command-r-plus' if 'command' in self.model_id else self.model_id,
332
  messages=[{"role": "system", "content": system_prompt},
333
  {"role": "user", "content": user_prompt}],
334
  temperature=0.0,
 
347
  else:
348
  self.tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-hf" if 'openelm' in self.model_id.lower() else self.model_id, trust_remote_code=True)
349
  print("Tokenizer loaded")
350
+ self.local_model = AutoModelForCausalLM.from_pretrained(self.model_id, trust_remote_code=True, device_map="auto", torch_dtype="auto", cache_dir='/home/paperspace/cache')
351
  print("Local model loaded")
352
 
353
  # Using local model