yangtb24 commited on
Commit
8fe2919
1 Parent(s): 989684f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -5
app.py CHANGED
@@ -718,12 +718,39 @@ def list_models():
718
  return jsonify({"error": "Unauthorized"}), 401
719
 
720
  detailed_models = []
 
721
  for model in text_models:
722
  detailed_models.append({
723
  "id": model,
724
  "object": "model",
725
  "created": 1678888888,
726
- "owned_by": random.choice(["linux do"]),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
727
  "permission": [
728
  {
729
  "id": f"modelperm-{uuid.uuid4().hex}",
@@ -796,10 +823,7 @@ def billing_usage():
796
  "total_usage": 0
797
  })
798
 
799
- @app.route(
800
- '/handsome/v1/dashboard/billing/subscription',
801
- methods=['GET']
802
- )
803
  def billing_subscription():
804
  if not check_authorization(request):
805
  return jsonify({"error": "Unauthorized"}), 401
 
718
  return jsonify({"error": "Unauthorized"}), 401
719
 
720
  detailed_models = []
721
+
722
  for model in text_models:
723
  detailed_models.append({
724
  "id": model,
725
  "object": "model",
726
  "created": 1678888888,
727
+ "owned_by": "openai",
728
+ "permission": [
729
+ {
730
+ "id": f"modelperm-{uuid.uuid4().hex}",
731
+ "object": "model_permission",
732
+ "created": 1678888888,
733
+ "allow_create_engine": False,
734
+ "allow_sampling": True,
735
+ "allow_logprobs": True,
736
+ "allow_search_indices": False,
737
+ "allow_view": True,
738
+ "allow_fine_tuning": False,
739
+ "organization": "*",
740
+ "group": None,
741
+ "is_blocking": False
742
+ }
743
+ ],
744
+ "root": model,
745
+ "parent": None
746
+ })
747
+
748
+ for model in embedding_models:
749
+ detailed_models.append({
750
+ "id": model,
751
+ "object": "model",
752
+ "created": 1678888888,
753
+ "owned_by": "openai",
754
  "permission": [
755
  {
756
  "id": f"modelperm-{uuid.uuid4().hex}",
 
823
  "total_usage": 0
824
  })
825
 
826
+ @app.route('/handsome/v1/dashboard/billing/subscription', methods=['GET'])
 
 
 
827
  def billing_subscription():
828
  if not check_authorization(request):
829
  return jsonify({"error": "Unauthorized"}), 401