yangtb24 commited on
Commit
1e64840
·
verified ·
1 Parent(s): 02d4ff9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -650,6 +650,7 @@ def handsome_chat_completions():
650
  "object": "chat.completion",
651
  "created": int(time.time()),
652
  "model": model_name,
 
653
  "choices": [
654
  {
655
  "index": 0,
@@ -660,6 +661,11 @@ def handsome_chat_completions():
660
  "finish_reason": "stop",
661
  }
662
  ],
 
 
 
 
 
663
  }
664
 
665
  except (KeyError, ValueError, IndexError) as e:
@@ -672,6 +678,7 @@ def handsome_chat_completions():
672
  "object": "chat.completion",
673
  "created": int(time.time()),
674
  "model": model_name,
 
675
  "choices": [
676
  {
677
  "index": 0,
@@ -682,6 +689,11 @@ def handsome_chat_completions():
682
  "finish_reason": "stop",
683
  }
684
  ],
 
 
 
 
 
685
  }
686
 
687
  logging.info(
 
650
  "object": "chat.completion",
651
  "created": int(time.time()),
652
  "model": model_name,
653
+ "system_fingerprint": "", # Added system_fingerprint
654
  "choices": [
655
  {
656
  "index": 0,
 
661
  "finish_reason": "stop",
662
  }
663
  ],
664
+ "usage": { # Added usage
665
+ "completion_tokens": 0,
666
+ "prompt_tokens": 0,
667
+ "total_tokens": 0
668
+ }
669
  }
670
 
671
  except (KeyError, ValueError, IndexError) as e:
 
678
  "object": "chat.completion",
679
  "created": int(time.time()),
680
  "model": model_name,
681
+ "system_fingerprint": "", # Added system_fingerprint
682
  "choices": [
683
  {
684
  "index": 0,
 
689
  "finish_reason": "stop",
690
  }
691
  ],
692
+ "usage": { # Added usage
693
+ "completion_tokens": 0,
694
+ "prompt_tokens": 0,
695
+ "total_tokens": 0
696
+ }
697
  }
698
 
699
  logging.info(