File size: 967 Bytes
9a1ab03
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import copy
import random
from threading import currentThread
from time import sleep

import streamlit as st
from streamlit.runtime.scriptrunner.script_run_context import \
    add_script_run_ctx

_TEST = """
Test of Time. A Benchmark for Evaluating LLMs on Temporal Reasoning. Large language models (LLMs) have \
showcased remarkable reasoning capabilities, yet they remain susceptible to errors, particularly in temporal \
reasoning tasks involving complex temporal logic.
"""

def generate_data_test():
    """A generator to pass to st.write_stream"""
    temp = copy.deepcopy(_TEST)
    l1 = temp.split()
    random.shuffle(l1)
    temp = ' '.join(l1)

    for word in temp.split(" "):
        print(word)
        yield word + " "
        sleep(0.1)


def stream_data_in_column(column, ctx):
    """Populate columns simultaneously"""

    add_script_run_ctx(currentThread(), ctx)
    print("11111111")
    with column:
        st.write_stream(generate_data_test)