Coder Social home page Coder Social logo

input_ls.json about k2 HOT 11 CLOSED

RichardScottOZ avatar RichardScottOZ commented on August 21, 2024
input_ls.json

from k2.

Comments (11)

RichardScottOZ avatar RichardScottOZ commented on August 21, 2024 1

Ah, very good! Have you tried anything like few shot inference here? People would probably like to see that too.

from k2.

davendw49 avatar davendw49 commented on August 21, 2024

Hi, Richard, againπŸ˜„, thanks for your advice. We uploaded some sample geoscience questions to the generation folder path.

from k2.

davendw49 avatar davendw49 commented on August 21, 2024

Good issue, and we are not showing this kind of cases. From my perspective, we use few shot to inference mostly on specific tasks like multiple-choice, information extraction or stimulate the ICL for specific format generation (which 7B model may not good at it).
We are undergoing training and evaluating a larger language model for geo, and we indeed design some cases to make our model be equipped with more abilities.

from k2.

RichardScottOZ avatar RichardScottOZ commented on August 21, 2024

Yeah, have the 'here are a few examples of texts' - is this text one of those type sort of check.

from k2.

RichardScottOZ avatar RichardScottOZ commented on August 21, 2024

When you are using your benchmark, maybe example :- paper suggests something like this?

{'id': 'apstudy_question_hg', 'question': {'stem': "The umbrella theory explaining the Earth's movement, contact, and flattening of large land plates is known as", 'choices': [{'text': 'the Coriolis effect', 'label': 'A'}, {'text': 'plate tectonics', 'label': 'B'}, {'text': 'hotspots', 'label': 'C'}, {'text': 'the Richter Magnitude Scale', 'label': 'D'}, {'text': 'the subduction zone', 'label': 'E'}]}, 'The answer is?': ''}

from k2.

RichardScottOZ avatar RichardScottOZ commented on August 21, 2024

Formatting this wrong will probably mean results will be somewhat different.?

from k2.

davendw49 avatar davendw49 commented on August 21, 2024

As we mentioned in the paper (Sec. 5.1 Objective tasks in GeoBenchmark), we prompt ending with the phrase "The answer is" and calculate the π‘†π‘œπ‘“π‘‘π‘šπ‘Žπ‘₯ of the probability of next token among the alphabet "A,B,C,D,E".

from k2.

RichardScottOZ avatar RichardScottOZ commented on August 21, 2024

I have run a test, with the generic generate function

[
 {
        "id": "apstudy_question_hg",
        "question": {
            "stem": "Because he figured out that sedimentary rock must have been compacted and compressed, over many ages, _______ is known as the father of modern geology.",
            "choices": [
                {
                    "text": "Richard Palmer",
                    "label": "A"
                },
                {
                    "text": "James Hutton",
                    "label": "B"
                },
                {
                    "text": "W",
                    "label": "C"
                },
                {
                    "text": "Nicholas Steno",
                    "label": "D"
                },
                {
                    "text": "Aubrey Hough",
                    "label": "E"
                }
            ]
        },
        "The Answer is?": ""
    }
]
[{"question": {"id": "apstudy_question_hg", "question": {"stem": "Because he figured out that sedimentary rock must have been compacted and compressed, over many ages, _______ is known as the father of modern geology.", "choices": [{"text": "Richard Palmer", "label": "A"}, {"text": "James Hutton", "label": "B"}, {"text": "W", "label": "C"}, {"text": "Nicholas Steno", "label": "D"}, {"text": "Aubrey Hough", "label": "E"}]}, "The Answer is?": ""}, "answer": "The correct answer is: B"}]

A different test?

from k2.

RichardScottOZ avatar RichardScottOZ commented on August 21, 2024

e.g. if want to adapt it to something not-Llama like Falcon or something else to try there

from k2.

davendw49 avatar davendw49 commented on August 21, 2024

As mentioned above, here I give you a toy example:

from transformers import AutoConfig, AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("/path/to/your/model", use_fast=True)
model = AutoModelForCausalLM.from_pretrained("/path/to/your/model", device_map="auto")
input = "Please select the correct option: The following substances are mainly formed by groundwater metasomatism: () \n A. nodule\n B. Quanhua\n C. silicified wood\n D. halite pseudocrystal\n\nThe answer is: ### Output\n"
input_ids = tokenizer(input, return_tensors='pt')
outputs = model(input_ids["input_ids"])

the outputs["logits"] is the probs of each token in vocab, and we can use tokenizer("A")['input_ids'][-1] to get the ids of the candidates alphabets and further do softmax among the probs of the candidates alphabets.

p.s. Since these questions are no longer related to the input_ls itself, I suggest to close this issue.

from k2.

RichardScottOZ avatar RichardScottOZ commented on August 21, 2024

Right, can add that to another one.

from k2.

Related Issues (13)

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.