Feature Extraction
Transformers
PyTorch
roberta
code-understanding
unixcoder
text-embeddings-inference
Instructions to use Henry65/RepoSim4Py with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Henry65/RepoSim4Py with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="Henry65/RepoSim4Py")# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("Henry65/RepoSim4Py") model = AutoModel.from_pretrained("Henry65/RepoSim4Py") - Notebooks
- Google Colab
- Kaggle
Update RepoPipeline.py
Browse files- RepoPipeline.py +2 -2
RepoPipeline.py
CHANGED
|
@@ -309,12 +309,12 @@ class RepoPipeline(Pipeline):
|
|
| 309 |
info["mean_readme_embedding"] = torch.mean(readme_embeddings, dim=0).cpu().numpy()
|
| 310 |
|
| 311 |
# Repo-level mean embedding
|
| 312 |
-
info["mean_repo_embedding"] =
|
| 313 |
info["mean_code_embedding"],
|
| 314 |
info["mean_doc_embedding"],
|
| 315 |
info["mean_requirement_embedding"],
|
| 316 |
info["mean_readme_embedding"]
|
| 317 |
-
],
|
| 318 |
|
| 319 |
# TODO Remove test
|
| 320 |
info["code_embeddings_shape"] = info["code_embeddings"].shape
|
|
|
|
| 309 |
info["mean_readme_embedding"] = torch.mean(readme_embeddings, dim=0).cpu().numpy()
|
| 310 |
|
| 311 |
# Repo-level mean embedding
|
| 312 |
+
info["mean_repo_embedding"] = np.concatenate([
|
| 313 |
info["mean_code_embedding"],
|
| 314 |
info["mean_doc_embedding"],
|
| 315 |
info["mean_requirement_embedding"],
|
| 316 |
info["mean_readme_embedding"]
|
| 317 |
+
], axis=1)
|
| 318 |
|
| 319 |
# TODO Remove test
|
| 320 |
info["code_embeddings_shape"] = info["code_embeddings"].shape
|