Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -70,10 +70,15 @@ if max_docs > 0:
|
|
70 |
example = samples[index_example]
|
71 |
|
72 |
st.markdown("#### File content:")
|
|
|
|
|
|
|
|
|
|
|
73 |
if example["lexable"]:
|
74 |
-
st.code(
|
75 |
else:
|
76 |
st.text(f"File can't be lexed so we remove syntax highlighting.\nContent:\n")
|
77 |
-
st.text(str(
|
78 |
else:
|
79 |
st.text("The dataset is empty after the filtering!")
|
|
|
70 |
example = samples[index_example]
|
71 |
|
72 |
st.markdown("#### File content:")
|
73 |
+
content = str(example["content"])
|
74 |
+
|
75 |
+
if len(content)>10_000:
|
76 |
+
content = example["content"][:10_000] + "\n[MORE CODE, DISPLAYING FIRST 10k CHARACTERS]"
|
77 |
+
|
78 |
if example["lexable"]:
|
79 |
+
st.code(content, language=chosen_language)
|
80 |
else:
|
81 |
st.text(f"File can't be lexed so we remove syntax highlighting.\nContent:\n")
|
82 |
+
st.text(str(content))
|
83 |
else:
|
84 |
st.text("The dataset is empty after the filtering!")
|