-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add basic embedding api for SDK
- Loading branch information
Showing
4 changed files
with
149 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,113 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".ui.home.HomeFragment"> | ||
|
||
<TextView | ||
android:id="@+id/text_home" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="8dp" | ||
android:layout_marginTop="8dp" | ||
android:layout_marginEnd="8dp" | ||
android:textAlignment="center" | ||
android:textSize="20sp" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".ui.home.HomeFragment"> | ||
|
||
<ScrollView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical" | ||
android:padding="16dp"> | ||
|
||
<!-- 标题部分 --> | ||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="horizontal" | ||
android:gravity="center_vertical"> | ||
|
||
<TextView | ||
android:id="@+id/text_home" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="Inference API" | ||
android:textSize="18sp" | ||
android:textStyle="bold"/> | ||
|
||
</LinearLayout> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="Sentence Similarity" | ||
android:textSize="14sp" | ||
android:textColor="@color/colorGray" | ||
android:layout_marginBottom="8dp"/> | ||
|
||
<EditText | ||
android:id="@+id/defaultSource" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:hint="Source Sentence" | ||
android:inputType="text"/> | ||
|
||
<!-- 子标题 --> | ||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="Sentences to compare to" | ||
android:textSize="14sp" | ||
android:textColor="@color/colorGray" | ||
android:layout_marginBottom="8dp"/> | ||
|
||
<!-- 输入表单 --> | ||
<EditText | ||
android:id="@+id/editTextSource" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:hint="Source Sentence" | ||
android:inputType="text" /> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="horizontal" | ||
android:gravity="center_horizontal"> | ||
|
||
<Button | ||
android:id="@+id/addButton" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="Add Sentence" | ||
android:onClick="add" | ||
android:layout_marginEnd="8dp"/> <!-- 添加一个间距 --> | ||
|
||
<Button | ||
android:id="@+id/computeButton" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="Compute" | ||
android:onClick="compute"/> | ||
|
||
</LinearLayout> | ||
|
||
<!-- 输出结果 --> | ||
<LinearLayout | ||
android:id="@+id/outputLayout" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical" | ||
android:layout_marginTop="16dp" | ||
android:visibility="gone"> | ||
|
||
|
||
<TextView | ||
android:id="@+id/jsonOutput" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="Output" | ||
android:layout_marginStart="8dp"/> | ||
|
||
</LinearLayout> | ||
|
||
</LinearLayout> | ||
</ScrollView> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters