Primary competition visual

Specializing Large Language Models for Telecom Networks by ITU AI/ML in 5G Challenge

€6 000 EUR
Completed (over 1 year ago)
Generative AI
468 joined
131 active
Starti
May 07, 24
Closei
Jul 26, 24
Reveali
Jul 26, 24
How to utilize the resources shared by officials
Help · 6 Jul 2024, 06:51 · 1

I have received the mail from officials containing FalconTest.rar file. Please share the demo code to utilize this resource.

Discussion 1 answer
User avatar
AdeptSchneider22
Kenyatta University

import json

url = URL

for i, row in tqdm(test_df.iterrows(), total=len(test_df), desc='Processing rows'):

question = row['question']

option1 = row['option 1']

option2 = row['option 2']

option3 = row['option 3']

option4 = row['option 4']

option5 = row['option 5']

category = row['category']

test_index = row['Test_Index']

results = timescale_retriever.get_relevant_documents(question)

query = TEST_DATASET_ALPACA_PROMPT.format(results, question, option1, option2, option3, option4, option5, category)

data = {

"inputs": query,

}

# Convert the dictionary to a JSON string

json_data = json.dumps(data)

# Set the appropriate headers for a JSON payload

headers = {

"Content-Type": "application/json"

}

try:

response = requests.post(url, data=json_data, headers=headers)

except Exception as e:

response = None

print("An error occurred:", e)

value = response.text["body"][0]["generated_text"]

answer_id = regex_query_response_postprocessor(value)

question_id = extract_question_id_from_test_df_index(test_index)

sample_submission_df = pd.concat([

sample_submission_df,

pd.DataFrame([{

'Question_ID': question_id,

'Answer_ID': answer_id,

'Task': 'Falcon 7.5B'

}])

], ignore_index=True)

6 Jul 2024, 07:12
Upvotes 2