OuroborosM commited on
Commit
af5e898
·
1 Parent(s): f5f3d9d

add embed_model

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -524,11 +524,11 @@ embed_model_id = 'sentence-transformers/all-MiniLM-L6-v2'
524
 
525
  # device = f'cuda:{cuda.current_device()}' if cuda.is_available() else 'cpu'
526
  device = 'cpu'
527
- # embed_model = HuggingFaceEmbeddings(
528
- # model_name=embed_model_id,
529
- # model_kwargs={'device': device},
530
- # encode_kwargs={'device': device, 'batch_size': 32}
531
- # )
532
 
533
  embeddings = embeddings_openai
534
 
 
524
 
525
  # device = f'cuda:{cuda.current_device()}' if cuda.is_available() else 'cpu'
526
  device = 'cpu'
527
+ embed_model = HuggingFaceEmbeddings(
528
+ model_name=embed_model_id,
529
+ model_kwargs={'device': device},
530
+ encode_kwargs={'device': device, 'batch_size': 32}
531
+ )
532
 
533
  embeddings = embeddings_openai
534