Coder Social home page Coder Social logo

Comments (6)

guody5 avatar guody5 commented on May 17, 2024

You also need to enter these command (including training command) in the inference:

lang=ruby #programming language
lr=5e-5
batch_size=32
beam_size=10
source_length=256
target_length=128
data_dir=../dataset
output_dir=model/$lang
train_file=$data_dir/$lang/train.jsonl
dev_file=$data_dir/$lang/valid.jsonl
epochs=10 
pretrained_model=microsoft/codebert-base #Roberta: roberta-base
batch_size=64
dev_file=$data_dir/$lang/valid.jsonl
test_file=$data_dir/$lang/test.jsonl
test_model=$output_dir/checkpoint-best-bleu/pytorch_model.bin #checkpoint for test

from codexglue.

lapplislazuli avatar lapplislazuli commented on May 17, 2024

@guody5 thank your for your answer,
but if I run it with all parameters, I will have to do the training?

I want to run just inference, like in the Readme.
Training+Inference works, but just Inference for a trained model fails.

from codexglue.

guoday avatar guoday commented on May 17, 2024
lang=ruby #programming language
lr=5e-5
batch_size=32
beam_size=10
source_length=256
target_length=128
data_dir=../dataset
output_dir=model/$lang
train_file=$data_dir/$lang/train.jsonl
dev_file=$data_dir/$lang/valid.jsonl
epochs=10 
pretrained_model=microsoft/codebert-base #Roberta: roberta-base
batch_size=64
dev_file=$data_dir/$lang/valid.jsonl
test_file=$data_dir/$lang/test.jsonl
test_model=$output_dir/checkpoint-best-bleu/pytorch_model.bin #checkpoint for test
python run.py --do_test --model_type roberta --model_name_or_path microsoft/codebert-base --load_model_path $test_model --dev_filename $dev_file --test_filename $test_file --output_dir $output_dir --max_source_length $source_length --max_target_length $target_length --beam_size $beam_size --eval_batch_size $batch_size

from codexglue.

guoday avatar guoday commented on May 17, 2024

In your error logs:
model_name_or_path should be "microsoft/codebert-base" but get '/models/pytorch_model.bin'

from codexglue.

guoday avatar guoday commented on May 17, 2024

According to your log, you should run the following command:

python run.py --do_test --model_type roberta --model_name_or_path microsoft/codebert-base --load_model_path /models/pytorch_model.bin --test_filename /dataset/test.jsonl --output_dir /experiment/output --max_source_length 256 --max_target_length 128 --beam_size 10 --eval_batch_size 32

from codexglue.

lapplislazuli avatar lapplislazuli commented on May 17, 2024

@guoday Thank you very much!
Works like a charm. I did not read properly that pretrained model and load_model were seperate things.

from codexglue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.