Skip to content

TryggTekst integrasjon #1319

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

TryggTekst integrasjon #1319

wants to merge 5 commits into from

Conversation

Majjki
Copy link

@Majjki Majjki commented Nov 5, 2024

Outbound policy for IP og port til TryggTekst

Endepunkt

ipv4:port/completion

Request

    api_url = 'http://0.0.0.0:8007/completion'
    json_body = {
        "stream":False,
        "n_predict":512,
        "temperature":0,
        "stop":["</s>","TryggTekst","User:",
            "<|end|>",
            "<|eot_id|>",
            "<|end_of_text|>",
            "<|im_end|>",
            "<|EOT|>",
            "<|END_OF_TURN_TOKEN|>",
            "<|end_of_turn|>",
            "<|endoftext|>",
            "Assistant",
            "User",
            "Response",
            "Instruction"
            "Llama",
            "Llama:",
            "TryggTekst:"
            "assistant",
            "assistant:",
        ],
        "penalize_nl":True,
        "repeat_last_n":256,
        "repeat_penalty":1.18,
        "top_k":40,
        "top_p":0.95,
        "min_p":0.05,
        "tfs_z":1,
        "typical_p":1,
        "presence_penalty":0,
        "frequency_penalty":0,
        "mirostat":0,
        "mirostat_tau":5,
        "mirostat_eta":0.1,
        "grammar": grammar,
        "n_probs":0,
        "image_data":[],
        "cache_prompt":False,
        "api_key":"",
        "slot_id":0,
        "prompt": prompt_formatter(userprompt)
    }

Mye av argumenten till request body kan sikkert fjernes etterhvert siden det har mange defaultverdier

Response

en json

{ "kategori": kategori }

der kategori er et av følgende:

* politisk oppfatning
* religion
* etnisk opprinnelse
* filosofisk oppfatning
* fagforeningsmedlemskap
* genetiske opplysninger
* biometriske opplysninger
* helseopplysninger
* seksuelle forhold
* seksuell legning
* ingen

Formatteringer

    formatted_prompt = f"<|start_header_id|>system<|end_header_id|>\n\n{system}<|start_header_id|>user<|end_header_id|>\n\n{input}<|eot_id|>assistant"

@Majjki Majjki requested a review from a team as a code owner November 5, 2024 09:38
Copy link

sonarqubecloud bot commented Nov 5, 2024

Copy link
Author

Choose a reason for hiding this comment

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

vet ikke helt hvor denne ska være i filstrukturen, men for tilfellet så er det lagt som en egen configfil, men tror vi ska endre så den ligger i backend senere


const api = axios.create({
// baseURL: 'http://0.0.0.0:8007',
baseURL: 'http://34.34.85.30:8007',
Copy link
Author

Choose a reason for hiding this comment

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

ip til gcp

Copy link

sonarqubecloud bot commented Mar 5, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

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.

2 participants