code-search-net/code_search_net
Viewer β’ Updated β’ 4.14M β’ 60.2k β’ 343
Run UDE-SE/BERTForReturnTypeClassification on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Use HF Jobs to fine-tune https://huggingface.co/UDE-SE/BERTForReturnTypeClassification. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Use HF Jobs to run batch inference with https://huggingface.co/UDE-SE/BERTForReturnTypeClassification on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
How to use UDE-SE/BERTForReturnTypeClassification with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="UDE-SE/BERTForReturnTypeClassification") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("UDE-SE/BERTForReturnTypeClassification")
model = AutoModelForSequenceClassification.from_pretrained("UDE-SE/BERTForReturnTypeClassification", device_map="auto")With this model, the return value can be classified based on the method name only. Six classes are available for this purpose. The model answers with the label indexes and the associated probability. The corresponding class name must then be taken from the following list: ['None', 'Number', 'Boolean', 'String', 'Object', 'Collection'].
The corresponding huggingface space can be found at https://huggingface.co/spaces/UDE-SE/ReturnTypePredictor.
Good luck trying it out!