Views
No views yet
SentenceTransformer(
(0): Transformer({'max_seq_length': 32768, 'do_lower_case': False, 'architecture': 'Qwen3Model'})
(1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': True, 'include_prompt': True})
(2): Normalize()
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("JacobLinCool/Qwen3-Embedding-0.6B-GIR-1")
5# Run inference
6queries = [
7 "Generates samples of text from the provided vocabulary.\n\n Args:\n plain_vocab: vocabulary.\n distribution: distribution.\n train_samples: samples for training.\n length: length.\n\n Returns:\n train_indices (np.array of Integers): random integers for training.\n shape = [num_samples, length]\n test_indices (np.array of Integers): random integers for testing.\n shape = [num_samples, length]\n plain_vocab (list of Integers): unique vocabularies.",
8]
9documents = [
10 'def generate_plaintext_random(plain_vocab, distribution, train_samples,\n length):\n \n if distribution is not None:\n assert len(distribution) == len(plain_vocab)\n\n train_indices = np.random.choice(\n range(len(plain_vocab)), (train_samples, length), p=distribution)\n\n return train_indices',
11 'def switch(self, name):\n \n try:\n switch = self.storage[self.__namespaced(name)]\n except KeyError:\n if not self.autocreate:\n raise ValueError("No switch named registered in " % (name, self.namespace))\n\n switch = self.__create_and_register_disabled_switch(name)\n\n switch.manager = self\n return switch',
12 'def late_filling(target, pressure=,\n Pc_star=,\n Swp_star=0.2, eta=3):\n r\n element = pressure.split()[0]\n network = target.project.network\n phase = target.project.find_phase(target)\n pc_star = phase[Pc_star]\n Pc = phase[pressure]\n \n Ts = network.map_throats(throats=target.Ts, origin=target)\n values = values[Ts]\n else:\n Ps = network.map_pores(pores=target.Ps, origin=target)\n values = values[Ps]\n return values',
13]
14query_embeddings = model.encode_query(queries)
15document_embeddings = model.encode_document(documents)
16print(query_embeddings.shape, document_embeddings.shape)
17# [1, 1024] [3, 1024]
18
19# Get the similarity scores for the embeddings
20similarities = model.similarity(query_embeddings, document_embeddings)
21print(similarities)
22# tensor([[ 0.8344, -0.0822, 0.0233]])InformationRetrievalEvaluator| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.99 |
| cosine_accuracy@5 | 1.0 |
| cosine_accuracy@10 | 1.0 |
| cosine_precision@1 | 0.99 |
| cosine_precision@3 | 0.3333 |
| cosine_precision@5 | 0.2 |
| cosine_precision@10 | 0.1 |
| cosine_recall@1 | 0.99 |
| cosine_recall@3 | 1.0 |
| cosine_recall@5 | 1.0 |
| cosine_recall@10 | 1.0 |
| cosine_ndcg@1 | 0.99 |
| cosine_ndcg@5 | 0.9963 |
| cosine_ndcg@10 | 0.9963 |
| cosine_mrr@1 | 0.99 |
| cosine_mrr@5 | 0.995 |
| cosine_mrr@10 | 0.995 |
| cosine_map@100 | 0.995 |
query and code| query | code | |
|---|---|---|
| type | string | string |
| details |
|
|
| query | code |
|---|---|
For memory actions, get a list of addresses it operates on.[object Object][object Object] :param SimAction action: The action object to work with.[object Object] :return: A list of addresses that are accessed with that action.[object Object] :rtype: list | def _get_actual_addrs(action, state):[object Object] [object Object][object Object] if action.actual_addrs is None:[object Object] [object Object] addr_list = {0x60000000} [object Object] else:[object Object] addr_list = set(action.actual_addrs)[object Object][object Object] return addr_list |
Construct the input file of the calculation. | def make_input(self, with_header=False):[object Object] [object Object] s = str(self.input)[object Object] if with_header: s = str(self) + "\n" + s[object Object] return s |
Check worker status route | def check_worker_status():[object Object] [object Object] if not in request.args:[object Object] resp = {"status": "bad request"}[object Object] return jsonify(**resp)[object Object] else:[object Object] worker_id = request.args[][object Object] assignment_id = request.args[][object Object] allow_repeats = CONFIG.getboolean(, )[object Object] if allow_repeats: [object Object] try:[object Object] part = Participant.query.<br> filter(Participant.workerid == worker_id).<br> filter(Participant.assignmentid == assignment_id).one()[object Object] status = part.status[object Object] except exc.SQLAlchemyError:[object Object] status = NOT_ACCEPTED[object Object] else: [object Object] try:[object Object] matches = Participant.query.<br> filter(Participant.workerid == worker_id).all()[object Object] numrecs = len(matches)[object Object] if numrecs==0: [object Object] status = NOT_ACCEPTED[object Object] else:[object Object] status = max([record.status for record in matches])[object Object] except exc.SQLAlchemyError:[object Object] ... |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim",
4 "gather_across_devices": false
5}query and code| query | code | |
|---|---|---|
| type | string | string |
| details |
|
|
| query | code |
|---|---|
Return the value of the android prefixed attribute in a specific tag.[object Object][object Object] This function will always try to get the attribute with a android: prefix first,[object Object] and will try to return the attribute without the prefix, if the attribute could not be found.[object Object] This is useful for some broken AndroidManifest.xml, where no android namespace is set,[object Object] but could also indicate malicious activity (i.e. wrongly repackaged files).[object Object] A warning is printed if the attribute is found without a namespace prefix.[object Object][object Object] If you require to get the exact result you need to query the tag directly:[object Object][object Object] example::[object Object] >>> from lxml.etree import Element[object Object] >>> tag = Element('bar', nsmap={'android': '[object Object])[object Object] >>> tag.set('{[object Object]', 'barfoo')[object Object] >>> tag.set('name', 'baz')[object Object] # Assume that [object Object] is some APK object[object Object] >>> a.get_value_from_tag(tag, 'name'... | def get_value_from_tag(self, tag, attribute):[object Object] [object Object][object Object] [object Object] [object Object] value = tag.get(self._ns(attribute))[object Object] if value is None:[object Object] value = tag.get(attribute)[object Object][object Object] if value:[object Object] [object Object] log.warning("Failed to get the attribute on tag with namespace. "[object Object] "But found the same attribute without namespace!".format(attribute, tag.tag))[object Object] return value |
Get information about this object as a dictionary. Used by WebSocket interface to pass some[object Object] relevant information to client applications. | def get_as_datadict(self):[object Object] [object Object] return dict(type=self.[object Object].[object Object], tags=list(self.tags)) |
Makes forecast with the estimated model[object Object][object Object] Parameters[object Object] ----------[object Object] h : int (default : 5)[object Object] How many steps ahead would you like to forecast?[object Object][object Object] past_values : int (default : 20)[object Object] How many past observations to show on the forecast graph?[object Object][object Object] intervals : Boolean[object Object] Would you like to show 95% prediction intervals for the forecast?[object Object][object Object] Returns[object Object] ----------[object Object] - Plot of the forecast | def plot_predict(self,h=5,past_values=20,intervals=True,**kwargs): [object Object] [object Object] import matplotlib.pyplot as plt[object Object] import seaborn as sns[object Object][object Object] figsize = kwargs.get(,(10,7))[object Object][object Object] if self.latent_variables.estimated is False:[object Object] raise Exception("No latent variables estimated!")[object Object] else:[object Object] [object Object] scale, shape, skewness = self._get_scale_and_shape(self.latent_variables.get_z_values(transformed=True))[object Object] previous_value = self.data[-1] [object Object] forecasted_values = np.ones(h)*self.states[-1] [object Object] date_index = self.shift_dates(h)[object Object] simulations = 10000[object Object] sim_vector = np.zeros([simulations,h])[object Object] t_params = self.transform_z()[object Object][object Object] for n in range(0,simulations): [object Object] rnd_q = np.random.normal(0,np.sqrt(self.latent_variables.get_z_values(transformed=True)[0]),h) [object Object] exp = forecasted_values.copy()[object Object][object Object] for t in range(0,h):[object Object] if t == 0:... |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim",
4 "gather_across_devices": false
5}eval_strategy: epochper_device_train_batch_size: 64per_device_eval_batch_size: 64num_train_epochs: 1warmup_ratio: 0.1seed: 2025bf16: Trueload_best_model_at_end: Trueoptim: adamw_torchpush_to_hub: Truehub_model_id: JacobLinCool/Qwen3-Embedding-0.6B-GIR-1hub_private_repo: Falsegradient_checkpointing: Trueeval_on_start: Truebatch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: epochprediction_loss_only: Trueper_device_train_batch_size: 64per_device_eval_batch_size: 64per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 5e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 1max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.1warmup_steps: 0log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Truesave_safetensors: Truesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseno_cuda: Falseuse_cpu: Falseuse_mps_device: Falseseed: 2025data_seed: Nonejit_mode_eval: Falseuse_ipex: Falsebf16: Truefp16: Falsefp16_opt_level: O1half_precision_backend: autobf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: 0ddp_backend: Nonetpu_num_cores: Nonetpu_metrics_debug: Falsedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Trueignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torchoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Trueuse_legacy_prediction_loop: Falsepush_to_hub: Trueresume_from_checkpoint: Nonehub_model_id: JacobLinCool/Qwen3-Embedding-0.6B-GIR-1hub_strategy: every_savehub_private_repo: Falsehub_always_push: Falsehub_revision: Nonegradient_checkpointing: Truegradient_checkpointing_kwargs: Noneinclude_inputs_for_metrics: Falseinclude_for_metrics: []eval_do_concat_batches: Truefp16_backend: autopush_to_hub_model_id: Nonepush_to_hub_organization: Nonemp_parameters:auto_find_batch_size: Falsefull_determinism: Falsetorchdynamo: Noneray_scope: lastddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: Falseneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Trueuse_liger_kernel: Falseliger_kernel_config: Noneeval_use_gather_object: Falseaverage_tokens_across_devices: Falseprompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Validation Loss | cosine_ndcg@10 |
|---|---|---|---|
| 0 | 0 | 0.0616 | 0.9926 |
| 1.0 | 7 | 0.0358 | 0.9963 |
| -1 | -1 | - | 0.9963 |
1@inproceedings{reimers-2019-sentence-bert,
2 title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
3 author = "Reimers, Nils and Gurevych, Iryna",
4 booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
5 month = "11",
6 year = "2019",
7 publisher = "Association for Computational Linguistics",
8 url = "https://arxiv.org/abs/1908.10084",
9}1@misc{henderson2017efficient,
2 title={Efficient Natural Language Response Suggestion for Smart Reply},
3 author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
4 year={2017},
5 eprint={1705.00652},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL}
8}