Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doc] Include inconclusive tests and optimizations for Huggingface #66

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

brainstorm
Copy link
Contributor

Checklist

  • Closing issues: #issue
  • Mark this if you consider it ready to merge
  • I've added tests (optional)
  • I wrote some documentation

Description

Minor tweaks on the huggingface side as discussed in #65 (comment), valuable as "documentation" in-code so that folks realise how bad huggingface models/inference is for this task at this point in time and current training/fine tuning.

@@ -230,7 +230,7 @@ You can write your custom decai commands in your ~/.radare2rc file.
//const hfModel = "codellama/CodeLlama-34b-Instruct-hf"; // Absolute rubbish
//const hfModel = "NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO"; // Lazy, doesn't even try to produce code, just describes it vaguely in prose
//const hfModel = "codellama/CodeLlama-13b-hf";
const hfModel = "nvidia/Llama-3.1-Nemotron-70B-Instruct-HF";
const hfModel = "nvidia/Llama-3.1-Nemotron-70B-Instruct-HF"; // Generates only partial outputs (begginning of decompilation)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ugh it always sounds too good to be true

Copy link
Contributor Author

@brainstorm brainstorm Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, here's an example output I played with on the free nvidia cloud (https://build.nvidia.com/nvidia/llama-3_1-nemotron-70b-instruct):

int processInput(int inputValue, int bitShift) {
    int result = 0;
    int stackPointer = 0;
    int accumulator = 0;

    for (int i = 0; i < 12; i++) {
        accumulator -= getStackValue(stackPointer + 0x11);
        accumulator -= getStackValue(stackPointer + 0xeb);
        if (isUnlikelyConditionMet()) {
            break;
        }
    }

    accumulator |= 0x78;
    accumulator |= getInputValue
    
[STOPS HERE] :_____(
WHYYYY, YOU WERE DOING KINDA WELL X"D

/cc @trufae

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple of things i can think of
what do you have for max tokens?
if you continue without a user message, does it resume?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just prompted it with:

Your output looks like a partial answer, please carry on and complete your answer in full?

And then it continued:

int processInput(int inputValue, int bitShift) {
    int result = 0;
    int stackPointer = 0;
    int accumulator = 0;

    for (int i = 0; i < 12; i++) {
        accumulator -= getStackValue(stackPointer + 0x11);
        accumulator -= getStackValue(stackPointer + 0xeb);
        if (isUnlikelyConditionMet()) {
            break;
        }
    }

    accumulator |= 0x78;
    accumulator |= getValueAtAddress(inputValue + 0xdba8);
    accumulator += inputValue;
    accumulator |= inputValue;
    decrementStackValue(stackPointer + 0x1e);
    accumulator |= getStackValue(stackPointer + 0x1e);

    if (isAnotherUnlikelyConditionMet()) {
        processFurther(inputValue, bitShift, &accumulator, &stackPointer);
    } else {
        finalizeProcessing(inputValue, &accumulator, &stackPointer);
    }

    return result;
}

void processFurther(int inputValue, int bitShift, int* accumulator, int* stackPointer) {
    *accumulator |= getStackValue(*stackPointer + 0x0a);
    decrementStackValue(*stackPointer + 0x14);
    if (isUnlikelyConditionMet()) {
        finalizeWithShift(inputValue, bitShift, accumulator);
    } else {
        updateStackAndAccumulator(stackPointer, accumulator);
    }
}

void finalizeProcessing(int inputValue, int* accumulator, int* stackPointer) {
    *accumulator ^= 0x35;
    shiftLeftStackValue(*stackPointer);
    *accumulator ^= 0x63;
    *accumulator -= getStackValue(*stackPointer);
    *accumulator ^= 0x06;
    storeResultInMemory(inputValue, *accumulator);
}

void finalizeWithShift(int inputValue, int bitShift, int* accumulator) {
    *accumulator <<= bitShift;
}

void updateStackAndAccumulator(int* stackPointer, int* accumulator) {
    (*stackPointer)++;
    *accumulator |= getStackValue(*stackPointer + 0x10);
}

void storeResultInMemory(int address, int value) {
    *(int*)(address + 0xde0400) = value;
}

int getStackValue(int address) {
    return *(int*)(address);
}

void decrementStackValue(int address) {
    (*(int*)(address))--;
}

void shiftLeftStackValue(int address) {
    (*(int*)(address)) <<= 1;
}

int isUnlikelyConditionMet() {
    // TO DO: implement condition check
    return 0;
}

int getValueAtAddress(int address) {
    return *(int*)(address);
}

void processInputWithGotosRemoved() {
    int inputValue = 0x1234; // example input
    int bitShift = 5; // example bit shift
    processInput(inputValue, bitShift);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future reference, the input was:

int fcn.0000807f (int x, int y) {
    loc_0x0000807f:
        goto 0x009a03 // 0x9a03 = unknown ()
        // XREFS(33)
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x00981e // 0x981e = unknown ()
        ~   goto 0x00b53b // 0xb53b = unknown ()
        // CODE XREF from fcn.0000807f @ 0x8103(x)
        [sp + 0xb5] = ![sp + 0xb5]
        sp -= 1// 0x8200 = [sp]
        res = a & (1 << 0x3b) // '//'
        
    loc_0x000080bf:
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x008ea1 // 0x8ea1 = unknown ()
        goto 0x008ee3 // 0x8ee3 = unknown ()
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x009730 // 0x9730 = unknown ()
        // DATA XREFS from fcn.0000852f @ 0x8cef(r), 0x8eeb(r)
        // DATA XREF from fcn.0000a2e1 @ +0x34c(r)
        // DATA XREF from fcn.0000ae0c @ 0xb001(r)
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x00b53b // 0xb53b = unknown ()
        goto 0x00b53b // 0xb53b = unknown ()
        a -= [sp + 0x11]
        a -= [sp + 0xeb]
        jrnv 0x000080b8 // unlikely
        goto loc_0x00008105;
        goto loc_0x00008105;
        return;
    loc_0x00008105:
        a |= 0x78
        a |= [x + 0xdba8]
        a += (x)
        a |= (x)
        [[sp + 0x1e]] --
        a |= [sp + 0x1e]
        jrnv 0x00008130 // unlikely
        goto loc_0x00008112;
    loc_0x00008130:
        // CODE XREF from fcn.0000807f @ 0x8110(x)
        jrnv 0x00008150 // unlikely
        goto loc_0x00008132;
    loc_0x00008150:
        a |= [sp + 0x0a]
        [[sp + 0x14]] --
        jrnv 0x0000817e // unlikely
        goto loc_0x00008156;
    loc_0x0000817e:
        ~   jrnv 0x000081b2 // unlikely
        ~   0x0000 = [sp] // sp += 1
        goto loc_0x00008180;
    loc_0x000081b2:
        0x1e3c = [sp] // sp += 1
        // DATA XREF from fcn.0000a2e1 @ 0xa925(r)
        [sp + 0x14] = [x]
        jrnv 0x000081f5 // unlikely
        goto loc_0x000081b9;
    loc_0x000081f5:
        // CODE XREF from fcn.0000807f @ 0x81b7(x)
        sp += 0x00
        [sp + 0x00] = ![sp + 0x00]
        a = !a
        
    loc_0x000081fa:
        a = [0x92]
        [sp + 0x00] = ![sp + 0x00]
        [sp + 0x80] = ![sp + 0x80]
        // DATA XREF from fcn.0000807f @ 0x80ba(w)
        // CALL XREF from fcn.00008377 @ 0x83a3(w)
        a |= 0xd0
        [sp + 0x00] = ![sp + 0x00]
        a >>= x
        [sp + 0xa7] = ![sp + 0xa7]
        a = [0x00]
        [sp + 0x02] = ![sp + 0x02]
        [sp + 0xa7] = ![sp + 0xa7]
        a |= 0x0000
        a >>= [sp + 0x00]
        [x + 0xde0400] = a
        [sp + 0x00] = ![sp + 0x00]
        a ^= 0x35
        sll [sp + 0x00]
        [sp + 0x00] = ![sp + 0x00]
        a ^= 0x63
        // CALL XREF from fcn.00008377 @ 0x8394(x)
        a -= [sp + 0x00]
        [sp + 0x00] = ![sp + 0x00]
        a ^= 0x06
        goto 0x00008228
        goto loc_0x00008138;
        goto loc_0x0000811a;
        return;
    loc_0x0000811a:
        0x3232 = [sp] // sp += 1
        [0x3c] ++
        [[sp + 0x0a]] --
        [sp + 0x32] = [x]
        [0x32] ++
        jrnv 0x00008159 // unlikely
        goto loc_0x00008127;
    loc_0x00008159:
        // CODE XREF from fcn.0000807f @ 0x8125(x)
        ~   jrnv 0x0000816f // unlikely
        ~   a |= [sp + 0x00]
        goto loc_0x0000815b;
    loc_0x0000816f:
        // CODE XREF from fcn.0000807f @ 0x8159(x)
        [[sp + 0x0a]] --
        [sp + 0x28] = [x]
        ~   jrnv 0x000081a7 // unlikely
        ~   0x0000 = [sp] // sp += 1
        goto loc_0x00008175;
    loc_0x000081a7:
        // CODE XREF from fcn.0000807f @ 0x8173(x)
        jrnv 0x000081db // unlikely
        goto loc_0x000081a9;
    loc_0x000081db:
        // CODE XREF from fcn.0000807f @ 0x81a7(x)
        a <<= x
        
    loc_0x000081dc:
        a = [0x10]
        [sp + 0x00] = ![sp + 0x00]
        [sp + 0x04] = ![sp + 0x04]
        res = x - 0xe300
        [sp + 0x00] = ![sp + 0x00]
        sll [sp + 0xa5]
        a >>= a
        [sp + 0x00] = ![sp + 0x00]
        [sp + 0x10] = ![sp + 0x10]
        [x + 0x050000] = a
        [sp + 0x20] = ![sp + 0x20]
        ~   [x + 0x5b0000] = a
        // CODE XREF from fcn.0000807f @ 0x81b7(x)
        sp += 0x00
        [sp + 0x00] = ![sp + 0x00]
        a = !a
        goto loc_0x00008129;
        return;
    loc_0x00008129:
        [[sp + 0x0a]] --
        a |= [sp + 0x1e]
        jrnv 0x00008161 // unlikely
        goto loc_0x0000812f;
    loc_0x00008161:
        // CODE XREF from fcn.0000807f @ 0x812d(x)
        0x3228 = [sp] // sp += 1
        ~   [sp + 0x0a] = [x]
        [[sp + 0x0a]] --
        [sp + 0x14] = [x]
        ~   [sp + 0x00] = [x]
        
    loc_0x0000816a:
        // CODE XREF from fcn.0000807f @ 0x8136(x)
        ~   jrnv 0x0000818a // unlikely
        // CODE XREF from fcn.0000807f @ 0x8155(x)
        ~   [sp + 0x00] = [x]
        goto loc_0x0000816c;
        goto loc_0x0000816c;
        return;
    loc_0x000080bf: // orphan
              // goto loc_0x00b53b            // 0xb53b = unknown ()
              // goto loc_0x00b53b            // 0xb53b = unknown ()
              // goto loc_0x00b53b            // 0xb53b = unknown ()
              // goto loc_0x008ee3            // 0x8ee3 = unknown ()
              // goto loc_0x009730            // 0x9730 = unknown () // DATA XREFS from fcn.0000852f @ 0x8cef(r), 0x8eeb(r) // DATA XREF from fcn.0000a2e1 @ +0x34c(r) // DATA XREF from fcn.0000ae0c @ 0xb001(r)
              // goto loc_0x00b53b            // 0xb53b = unknown ()
              // goto loc_0x00b53b            // 0xb53b = unknown ()
              // goto loc_0x00b53b            // 0xb53b = unknown ()
         a -= [sp + 0x11]
         a -= [sp + 0xeb]
         jrnv 0x000080b8          // unlikely

         goto loc_0x000080b8
    loc_0x00008228: // orphan
         // CODE XREFS from fcn.0000807f @ 0x807f(x), 0x8226(x)
         [sp + 0x00] = ![sp + 0x00]
         a ^= 0x1e
         a = !a
         [sp + 0x00] = ![sp + 0x00]
         [sp + 0xa7] = ![sp + 0xa7]
         a -= (x)
         a ^= 0x8f
         a = !a
         [sp + 0x00] = ![sp + 0x00]
         [sp + 0x20] = ![sp + 0x20]
         [sp + 0x00] = ![sp + 0x00]
         [sp + 0x10] = ![sp + 0x10] // CALL XREF from fcn.00008377 @ 0x838f(x)
         [sp + 0x00] = ![sp + 0x00]
         [sp + 0x04] = ![sp + 0x04]
         [sp + 0x00] = ![sp + 0x00]
         [sp + 0x08] = ![sp + 0x08]
         [sp + 0x00] = ![sp + 0x00]
         [sp + 0x00] = ![sp + 0x00]
         [sp + 0x00] = ![sp + 0x00]
         a <<= x
         [sp + 0x00] = ![sp + 0x00]
         if (res == 0) 
    loc_0x00008260: // orphan
         // CODE XREF from fcn.0000807f @ 0x824e(x)
         a = [sp] // sp += 1
         return

        return;
    loc_0x00008250: // orphan
         [sp + 0x00] = ![sp + 0x00]
         [sp + 0x64] = ![sp + 0x64]
         return

        return;
    loc_0x000081b9: // orphan
         // DATA XREF from fcn.0000a2e1 @ 0xa933(r)
         0x3228 = [sp] // sp += 1

         goto loc_0x000081bc
    loc_0x000081fa: // orphan
         a = [0x92]
         [sp + 0x00] = ![sp + 0x00]
         [sp + 0x80] = ![sp + 0x80] // DATA XREF from fcn.0000807f @ 0x80ba(w) // CALL XREF from fcn.00008377 @ 0x83a3(w)
         a |= 0xd0
         [sp + 0x00] = ![sp + 0x00]
         a >>= x
         [sp + 0xa7] = ![sp + 0xa7]
         a = [0x00]
         [sp + 0x02] = ![sp + 0x02]
         [sp + 0xa7] = ![sp + 0xa7]
         a |= 0x0000
         a >>= [sp + 0x00]
         [x + 0xde0400] = a
         [sp + 0x00] = ![sp + 0x00]
         a ^= 0x35
         sll [sp + 0x00]
         [sp + 0x00] = ![sp + 0x00]
         a ^= 0x63 // CALL XREF from fcn.00008377 @ 0x8394(x)
         a -= [sp + 0x00]
         [sp + 0x00] = ![sp + 0x00]
         a ^= 0x06
         
         goto loc_0x00008228
    loc_0x00008180: // orphan
         [0x28] ++

         goto loc_0x00008182
    loc_0x000081bc: // orphan
         // CODE XREF from fcn.0000807f @ 0x819c(x)
         0x3c1e = [sp] // sp += 1
         [sp + 0x00] = [x] // DATA XREF from fcn.0000a2e1 @ 0xa94f(r)
         [sp + 0x01] = ![sp + 0x01]
         sll [x + 0x00] // DATA XREF from fcn.0000a2e1 @ 0xa95d(r)
         [[sp + 0x42]] = 0        // 'B'
         a = !a
         [sp + 0x00] = ![sp + 0x00]

         goto loc_0x000081ca
    loc_0x0000819e: // orphan
         [0x1e] ++
         a |= [sp + 0x14]
         [sp + 0x28] = [x]
         0x3c32 = [sp] // sp += 1

         goto loc_0x000081a7
    loc_0x000081dc: // orphan
         a = [0x10]
         [sp + 0x00] = ![sp + 0x00]
         [sp + 0x04] = ![sp + 0x04]
         res = x - 0xe300
         [sp + 0x00] = ![sp + 0x00]
         sll [sp + 0xa5]
         a >>= a
         [sp + 0x00] = ![sp + 0x00]
         [sp + 0x10] = ![sp + 0x10]
         [x + 0x050000] = a
         [sp + 0x20] = ![sp + 0x20]
     ~   [x + 0x5b0000] = a // CODE XREF from fcn.0000807f @ 0x81b7(x)
         sp += 0x00
         [sp + 0x00] = ![sp + 0x00]
         a = !a

         goto loc_0x000081fa
    loc_0x000081a9: // orphan
     ~   [0x28] ++
         jrnv 0x000081ca          // unlikely
         [sp + 0x32] = [x]
         [0x32] ++

         goto loc_0x000081b0
    loc_0x000081d0: // orphan
         // CODE XREF from fcn.0000807f @ 0x81b0(x)
         [sp + 0x10] = ![sp + 0x10]
         [sp + 0x00] = ![sp + 0x00]
         [sp + 0x01] = ![sp + 0x01]
         [sp + 0x00] = ![sp + 0x00]
     ~   [sp + 0x02] = ![sp + 0x02] // CODE XREF from fcn.0000807f @ 0x81a7(x)
         a <<= x

         goto loc_0x000081dc
    loc_0x00008156: // orphan
     ~   a |= [sp + 0x14]
     ~   a |= [sp + 0x00]

         goto loc_0x00008158
    loc_0x00008182: // orphan
     ~   [sp + 0x1e] = [x]
         [sp + 0x1e] = [x]
         [0x3c] ++
         [0x32] ++
     ~   0x281e = [sp] // sp += 1
         jrnv 0x000081aa          // unlikely
         [sp + 0x1e] = [x]
         a |= [sp + 0x32]
         [0x32] ++

         goto loc_0x00008192
    loc_0x0000815a: // orphan
     ~   a |= [sp + 0x0a] // CODE XREF from fcn.0000807f @ 0x8145(x)
         [[sp + 0x0a]] --
         [sp + 0x28] = [x]
     ~   0x0000 = [sp] // sp += 1

    loc_0x00008192: // orphan
         [0x3c] ++
         0x281e = [sp] // sp += 1
         [sp + 0x14] = [x]
         0x3228 = [sp] // sp += 1

         goto loc_0x0000819c
    loc_0x00008160: // orphan
     ~   0x3232 = [sp] // sp += 1 // CODE XREF from fcn.0000807f @ 0x812d(x)
         0x3228 = [sp] // sp += 1
     ~   [sp + 0x00] = [x]

    loc_0x00008183: // orphan
         [sp + 0x1e] = [x]
         [0x3c] ++
         [0x32] ++
     ~   0x281e = [sp] // sp += 1
         jrnv 0x000081aa          // unlikely

         goto loc_0x0000818c
    loc_0x00008165: // orphan
         [[sp + 0x0a]] --
         [sp + 0x14] = [x]
     ~   [sp + 0x28] = [x]
     ~   // CODE XREF from fcn.0000807f @ 0x8136(x)
     ~   jrnv 0x0000816c          // unlikely

         goto loc_0x0000816b
    loc_0x00008175: // orphan
         0x323c = [sp] // sp += 1
         [0x0a] ++
         [sp + 0x1e] = [x]
     ~   0x3c28 = [sp] // sp += 1
     ~   jrnv 0x00008180          // unlikely

         goto loc_0x0000817f
    loc_0x00008132: // orphan
         [sp + 0x0a] = [x]
         [[sp + 0x1e]] --
         jrnv 0x0000816a          // unlikely

    loc_0x0000816a: // orphan
     ~   // CODE XREF from fcn.0000807f @ 0x8136(x)
     ~   jrnv 0x0000818a          // unlikely
     ~   // CODE XREF from fcn.0000807f @ 0x8155(x)
     ~   [sp + 0x00] = [x]

    loc_0x0000818a: // orphan
         jrnv 0x000081aa          // unlikely

    loc_0x000081aa: // orphan
         jrnv 0x000081ca          // unlikely

    loc_0x000081ca: // orphan
         [sp + 0x0c] = ![sp + 0x0c]
         [sp + 0x00] = ![sp + 0x00]
         [sp + 0x30] = ![sp + 0x30]

         goto loc_0x000081d0
    loc_0x000081ac: // orphan
         [sp + 0x32] = [x]
         [0x32] ++

    loc_0x000081b0: // orphan
         jrnv 0x000081d0          // unlikely

         goto loc_0x000081d0
    loc_0x0000818c: // orphan
         [sp + 0x1e] = [x]
         a |= [sp + 0x32]
         [0x32] ++

         goto loc_0x00008192
    loc_0x0000816c: // orphan
     ~   a |= [sp + 0x14] // CODE XREF from fcn.0000807f @ 0x814d(x)
         a |= [sp + 0x14] // CODE XREF from fcn.0000807f @ 0x8159(x)
         [[sp + 0x0a]] --
         [sp + 0x28] = [x]
     ~   jrnv 0x00008175          // unlikely

    loc_0x0000819c: // orphan
         jrnv 0x000081bc          // unlikely

         goto loc_0x000081bc
    loc_0x00008174: // orphan
     ~   0x3232 = [sp] // sp += 1
         0x323c = [sp] // sp += 1
         [0x0a] ++
         [sp + 0x1e] = [x]
     ~   0x3c28 = [sp] // sp += 1
     ~   jrnv 0x00008180          // unlikely

    loc_0x0000817f: // orphan
     ~   0x3c28 = [sp] // sp += 1
         [0x28] ++

         goto loc_0x00008182
    loc_0x00008138: // orphan
         jrnv 0x00008158          // unlikely

    loc_0x00008158: // orphan
     ~   // CODE XREF from fcn.0000807f @ 0x8138(x)
     ~   jrnv 0x00008182          // unlikely
     ~   // CODE XREF from fcn.0000807f @ 0x8125(x)
     ~   jrnv 0x0000815b          // unlikely

         goto loc_0x00008182
    loc_0x0000813a: // orphan
         a |= [sp + 0x0a]
         [[sp + 0x0a]] --
         [[sp + 0x14]] --
         [sp + 0x28] = [x]

         goto loc_0x00008142
    loc_0x0000815b: // orphan
         // CODE XREF from fcn.0000807f @ 0x8145(x)
         [[sp + 0x0a]] --
         [sp + 0x28] = [x]
     ~   0x3232 = [sp] // sp += 1
     ~   0x3232 = [sp] // sp += 1 // CODE XREF from fcn.0000807f @ 0x812d(x)
         0x3228 = [sp] // sp += 1
     ~   [sp + 0x00] = [x]

         goto loc_0x00008165
    loc_0x00008147: // orphan
         // CODE XREF from fcn.0000807f @ 0x8127(x)
         [[sp + 0x0a]] -- // DATA XREF from fcn.0000a2e1 @ 0xa371(r)
         [sp + 0x32] = [x]
         [sp + 0x28] = [x] // DATA XREFS from fcn.0000a2e1 @ 0xa3ad(r), 0xa3ea(r)
         jrnv 0x0000816d          // unlikely

    loc_0x0000816d: // orphan
         // CODE XREF from fcn.0000807f @ 0x814d(x)
         a |= [sp + 0x14]

         goto loc_0x0000816f
    loc_0x0000814f: // orphan
     ~   [sp + 0x14] = [x]
         a |= [sp + 0x0a]
         [[sp + 0x14]] --
         jrnv 0x0000817e          // unlikely
     ~   a |= [sp + 0x00]

    loc_0x0000816b: // orphan
     ~   // CODE XREF from fcn.0000807f @ 0x8155(x)
     ~   [sp + 0x14] = [x]
     ~   a |= [sp + 0x00]

         goto loc_0x0000816d
    loc_0x00008157: // orphan
     ~   a |= [sp + 0x28]
     ~   // CODE XREF from fcn.0000807f @ 0x8138(x)
     ~   jrnv 0x0000815a          // unlikely

         goto loc_0x00008159
    loc_0x00008112: // orphan
         a |= [sp + 0x14]
         a |= [sp + 0x0a]
         [[sp + 0x1e]] --
         jrnv 0x00008142          // unlikely

    loc_0x00008142: // orphan
         // CODE XREF from fcn.0000807f @ 0x8118(x)
         0x3c32 = [sp] // sp += 1 // DATA XREF from fcn.00009d85 @ +0x34(r)
         jrnv 0x0000815b          // unlikely

         goto loc_0x0000815b
    loc_0x00008127: // orphan
         jrnv 0x00008147          // unlikely

         goto loc_0x00008147
    loc_0x0000812f: // orphan
     ~   0x281e = [sp] // sp += 1 // CODE XREF from fcn.0000807f @ 0x8110(x)
         jrnv 0x00008150          // unlikely

         goto loc_0x00008132
}

Copy link
Contributor Author

@brainstorm brainstorm Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you have for max tokens?

According to the "Model card":

Input:

Input Type(s): Text
Input Format: String
Input Parameters: One Dimensional (1D)
Other Properties Related to Input: Max of 128k tokens
Output:

Output Type(s): Text
Output Format: String
Output Parameters: One Dimensional (1D)
Other Properties Related to Output: Max of 4k tokens

So it's more limited on the output, but there's plenty of room to do inference on microcontroller functions!

…s NGC cloud, it should work as well in HuggingFace's PRO subscription tier too?
decai/decai.r2.js Outdated Show resolved Hide resolved
@@ -256,10 +256,6 @@ You can write your custom decai commands in your ~/.radare2rc file.
}

try {
const o = JSON.parse(res);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error will just be catched in catch(e) { so no need to do this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. The trycatch captures javascript errors, like invalid json, the other part is related to the huggingface internal errors which are reported in the json response. So this part is necessary

@trufae
Copy link
Contributor

trufae commented Oct 22, 2024

Dont do merge commits, fix the conflicts

const curlcmd = `curl -s https://api-inference.huggingface.co/models/${hfModel}
-H "Authorization: Bearer ${hfKey}"
-H "Content-Type: application/json"
const curlcmd = `curl -X POST -s https://api-inference.huggingface.co/models/${hfModel} \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you make a PR with only this change? btw the hfModel thing shuold be honoring decaiModel config variable, this way you dont need to change it in the source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants